Class: Tdc::ExtendedAttributes::DefaultInterpreter
- Inherits:
-
InterpreterBase
- Object
- InterpreterBase
- Tdc::ExtendedAttributes::DefaultInterpreter
- Defined in:
- lib/tdc/extended_attributes/default_interpreter.rb
Overview
Know how on interpret extended attributes.
Note: extended attribute keys are expected to be strings rather than symbols.
Instance Method Summary collapse
Instance Method Details
#interpret(instance_definition) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tdc/extended_attributes/default_interpreter.rb', line 9 def interpret(instance_definition) extended_attribute_definitions = keep_extended_attributes(instance_definition) extended_attribute_definitions.each do |extended_attribute_key, extended_attribute_value| # Remove the extended attribute. instance_definition.delete(extended_attribute_key) # Add the extended attribute back as a standard attribute. instance_definition[convert_to_standard_attribute(extended_attribute_key)] = extended_attribute_context.instance_eval(extended_attribute_value) end end |