Class: SyntaxTree::Reflection::Attribute

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#commentObject (readonly)

Returns the value of attribute comment.



128
129
130
# File 'lib/syntax_tree/reflection.rb', line 128

def comment
  @comment
end

#nameObject (readonly)

Returns the value of attribute name.



128
129
130
# File 'lib/syntax_tree/reflection.rb', line 128

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



128
129
130
# File 'lib/syntax_tree/reflection.rb', line 128

def type
  @type
end