Class: XDry::NFieldDef
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(name, type) ⇒ NFieldDef
constructor
A new instance of NFieldDef.
- #persistent? ⇒ Boolean
- #to_s ⇒ Object
- #to_source ⇒ Object
- #wants_constructor? ⇒ Boolean
- #wants_property? ⇒ Boolean
Methods inherited from Node
#method_missing, #tagged_with?, #tags, #tags=, #tags_comment
Constructor Details
#initialize(name, type) ⇒ NFieldDef
Returns a new instance of NFieldDef.
44 45 46 47 |
# File 'lib/xdry/parsing/nodes.rb', line 44 def initialize name, type super() @name, @type = name, type end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class XDry::Node
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
42 43 44 |
# File 'lib/xdry/parsing/nodes.rb', line 42 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
42 43 44 |
# File 'lib/xdry/parsing/nodes.rb', line 42 def type @type end |
Instance Method Details
#persistent? ⇒ Boolean
49 50 51 |
# File 'lib/xdry/parsing/nodes.rb', line 49 def persistent? tagged_with? 'persistent' end |
#to_s ⇒ Object
61 62 63 |
# File 'lib/xdry/parsing/nodes.rb', line 61 def to_s "#{@type} #{@name}#{}" end |
#to_source ⇒ Object
65 66 67 |
# File 'lib/xdry/parsing/nodes.rb', line 65 def to_source "#{@type.to_source_with_space}#{@name};" end |
#wants_constructor? ⇒ Boolean
57 58 59 |
# File 'lib/xdry/parsing/nodes.rb', line 57 def wants_constructor? tagged_with? 'wants-constructor' end |
#wants_property? ⇒ Boolean
53 54 55 |
# File 'lib/xdry/parsing/nodes.rb', line 53 def wants_property? tagged_with? 'wants-property' end |