Class: SyntaxTree::Reflection::Attribute
- Inherits:
-
Object
- Object
- SyntaxTree::Reflection::Attribute
- Defined in:
- lib/syntax_tree/reflection.rb
Overview
This class represents one of the attributes on a node in the tree.
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, comment) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name, comment) ⇒ Attribute
Returns a new instance of Attribute.
130 131 132 133 134 |
# File 'lib/syntax_tree/reflection.rb', line 130 def initialize(name, comment) @name = name @comment = comment @type = Type.parse(comment) end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
128 129 130 |
# File 'lib/syntax_tree/reflection.rb', line 128 def comment @comment end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
128 129 130 |
# File 'lib/syntax_tree/reflection.rb', line 128 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
128 129 130 |
# File 'lib/syntax_tree/reflection.rb', line 128 def type @type end |