Class: Cocoadex::DataType
- Inherits:
-
SequentialNodeElement
- Object
- Element
- SequentialNodeElement
- Cocoadex::DataType
- Defined in:
- lib/cocoadex/models/data_type.rb
Defined Under Namespace
Classes: Field
Constant Summary collapse
- TEMPLATE_NAME =
:data_type
Constants inherited from SequentialNodeElement
SequentialNodeElement::Abstract, SequentialNodeElement::Availability, SequentialNodeElement::Declaration, SequentialNodeElement::DeclaredIn, SequentialNodeElement::Discussion, SequentialNodeElement::ReturnValue, SequentialNodeElement::Special
Instance Attribute Summary collapse
-
#abstract ⇒ Object
readonly
Returns the value of attribute abstract.
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
-
#considerations ⇒ Object
readonly
Returns the value of attribute considerations.
-
#declaration ⇒ Object
readonly
Returns the value of attribute declaration.
-
#declared_in ⇒ Object
readonly
Returns the value of attribute declared_in.
-
#discussion ⇒ Object
readonly
Returns the value of attribute discussion.
-
#next_termdef ⇒ Object
Returns the value of attribute next_termdef.
Attributes inherited from Element
Instance Method Summary collapse
- #constants ⇒ Object
- #fields ⇒ Object
- #handle_node(node) ⇒ Object
- #origin ⇒ Object
- #termdef_to_properties(termdef) ⇒ Object
Methods inherited from SequentialNodeElement
Methods inherited from Element
#<=>, #parse_parameters, #print, #to_s, #type
Methods included from Bri::Templates::Helpers
Constructor Details
This class inherits a constructor from Cocoadex::SequentialNodeElement
Instance Attribute Details
#abstract ⇒ Object (readonly)
Returns the value of attribute abstract.
9 10 11 |
# File 'lib/cocoadex/models/data_type.rb', line 9 def abstract @abstract end |
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
9 10 11 |
# File 'lib/cocoadex/models/data_type.rb', line 9 def availability @availability end |
#considerations ⇒ Object (readonly)
Returns the value of attribute considerations.
9 10 11 |
# File 'lib/cocoadex/models/data_type.rb', line 9 def considerations @considerations end |
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
9 10 11 |
# File 'lib/cocoadex/models/data_type.rb', line 9 def declaration @declaration end |
#declared_in ⇒ Object (readonly)
Returns the value of attribute declared_in.
9 10 11 |
# File 'lib/cocoadex/models/data_type.rb', line 9 def declared_in @declared_in end |
#discussion ⇒ Object (readonly)
Returns the value of attribute discussion.
9 10 11 |
# File 'lib/cocoadex/models/data_type.rb', line 9 def discussion @discussion end |
#next_termdef ⇒ Object
Returns the value of attribute next_termdef.
11 12 13 |
# File 'lib/cocoadex/models/data_type.rb', line 11 def next_termdef @next_termdef end |
Instance Method Details
#constants ⇒ Object
17 18 19 |
# File 'lib/cocoadex/models/data_type.rb', line 17 def constants @constants ||= [] end |
#fields ⇒ Object
13 14 15 |
# File 'lib/cocoadex/models/data_type.rb', line 13 def fields @fields ||= [] end |
#handle_node(node) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/cocoadex/models/data_type.rb', line 25 def handle_node node if ["Fields","Constants"].include? node.text next_termdef = node.text elsif node.classes.include? "termdef" and not next_termdef.nil? if list = termdef_to_properties(next_termdef) node.css("dt").each do |field_title_node| field_name = field_title_node.css("code").text description = field_title_node.next.text list << Field.new(field_name, description) end next_termdef = "" end end end |
#origin ⇒ Object
21 22 23 |
# File 'lib/cocoadex/models/data_type.rb', line 21 def origin @origin end |
#termdef_to_properties(termdef) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/cocoadex/models/data_type.rb', line 40 def termdef_to_properties termdef case termdef when "Fields" then fields when "Constants" then constants end end |