Class: XDry::NSynthesize
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(items) ⇒ NSynthesize
constructor
A new instance of NSynthesize.
- #item_for_property_named(property_name) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Node
#method_missing, #tagged_with?, #tags, #tags=, #tags_comment
Constructor Details
#initialize(items) ⇒ NSynthesize
Returns a new instance of NSynthesize.
181 182 183 |
# File 'lib/xdry/parsing/nodes.rb', line 181 def initialize items @items = items end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class XDry::Node
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
179 180 181 |
# File 'lib/xdry/parsing/nodes.rb', line 179 def items @items end |
Class Method Details
.parse(string) ⇒ Object
193 194 195 196 197 |
# File 'lib/xdry/parsing/nodes.rb', line 193 def self.parse string if string =~ /^@synthesize\s+(.*);$/ NSynthesize.new($1.strip.split(/\s+,\s+/).collect { |s| SynthesizeItem.parse(s) }.compact) end end |
Instance Method Details
#item_for_property_named(property_name) ⇒ Object
185 186 187 |
# File 'lib/xdry/parsing/nodes.rb', line 185 def item_for_property_named property_name @items.find { |item| item.property_name == property_name } end |
#to_s ⇒ Object
189 190 191 |
# File 'lib/xdry/parsing/nodes.rb', line 189 def to_s "@synthesize " + @items.join(", ") + ";" end |