Class: Cocoadex::ConstantGroup
- Inherits:
-
SequentialNodeElement
- Object
- Element
- SequentialNodeElement
- Cocoadex::ConstantGroup
- Defined in:
- lib/cocoadex/models/constant.rb
Constant Summary collapse
- TEMPLATE_NAME =
:constant_group
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.
-
#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.
Attributes inherited from Element
Instance Method Summary collapse
Methods inherited from SequentialNodeElement
Methods inherited from Element
#<=>, #origin, #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.
6 7 8 |
# File 'lib/cocoadex/models/constant.rb', line 6 def abstract @abstract end |
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
6 7 8 |
# File 'lib/cocoadex/models/constant.rb', line 6 def declaration @declaration end |
#declared_in ⇒ Object (readonly)
Returns the value of attribute declared_in.
6 7 8 |
# File 'lib/cocoadex/models/constant.rb', line 6 def declared_in @declared_in end |
#discussion ⇒ Object (readonly)
Returns the value of attribute discussion.
6 7 8 |
# File 'lib/cocoadex/models/constant.rb', line 6 def discussion @discussion end |
Instance Method Details
#constants ⇒ Object
9 10 11 |
# File 'lib/cocoadex/models/constant.rb', line 9 def constants @constants ||= [] end |
#handle_node(node) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cocoadex/models/constant.rb', line 13 def handle_node node if node.classes.include? "termdef" node.css("dt").each do |field_title_node| source = "#{@origin} > #{@name}" field_name = field_title_node.css("code").text description = field_title_node.next.css("p").map {|p| p.text}.join("\n") constants << Constant.new(source,field_name, description) end elsif node.name == "p" and node.classes.empty? @abstract = node.text end end |