Powered by SmartDoc

Binding (.ckd)

In ckd file, you decide types of the elements and their behavior. Please be care of the grammar of ckd file. Its grammar is different from that of Ruby or HTML. In ckd file, all the attributes of the element are enclosed by braces, "{}", and an attribute is separated by semicolon, ";". You can omit semicolon with using return as term.

name of element : type of element {
  attribute = value

  # semicolon
  attribute = value; attribute = value;

The value of the attribute is Ruby's method, string, number and true/false. When you use string in ckd file, you surround the value with single/double quotation mark.

HelloWorld : CKString {
  value = sayHello;

In this ckd file, you declare that you use "HelloWorld" element whose type is CKString and that "say_hello" method of HelloWorld class is set to "value" attribute of "HelloWorld" element.


You can use these literals in binding files.

Literal Format
String 'abc', "string", ...
Digit 1, 2, 3, 4, 5, ...
true/false, nil true, false, nil, ...
Array [array], [0], [1], ...
Hash [key], ['abc'], ["string"], [0], [1], ...