Class: PSD::EngineData::Instruction::PropertyWithData
- Inherits:
-
PSD::EngineData::Instruction
- Object
- PSD::EngineData::Instruction
- PSD::EngineData::Instruction::PropertyWithData
- Defined in:
- lib/psd/enginedata/instructions/property_with_data.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from PSD::EngineData::Instruction
#initialize, match, #match, #method_missing
Constructor Details
This class inherits a constructor from PSD::EngineData::Instruction
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PSD::EngineData::Instruction
Class Method Details
.token ⇒ Object
6 |
# File 'lib/psd/enginedata/instructions/property_with_data.rb', line 6 def self.token; /^\/([A-Z0-9]+) (.*)$/i; end |
Instance Method Details
#execute! ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/psd/enginedata/instructions/property_with_data.rb', line 8 def execute! set_property match[1] data = parse_tokens match[2] if node.is_a?(PSD::EngineData::Node) node[property] = data elsif node.is_a?(Array) node.push data end end |