Class: XMigra::ImpdeclMigrationAdder::SupportedObjectDeserializer
- Defined in:
- lib/xmigra/impdecl_migration_adder.rb
Instance Attribute Summary collapse
-
#db_specifics ⇒ Object
readonly
Returns the value of attribute db_specifics.
-
#object_name ⇒ Object
readonly
Returns the value of attribute object_name.
Instance Method Summary collapse
- #deserialize(yaml_node) ⇒ Object
-
#initialize(object_name, db_specifics) ⇒ SupportedObjectDeserializer
constructor
A new instance of SupportedObjectDeserializer.
Constructor Details
#initialize(object_name, db_specifics) ⇒ SupportedObjectDeserializer
Returns a new instance of SupportedObjectDeserializer.
224 225 226 227 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 224 def initialize(object_name, db_specifics) @object_name = object_name @db_specifics = db_specifics end |
Instance Attribute Details
#db_specifics ⇒ Object (readonly)
Returns the value of attribute db_specifics.
229 230 231 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 229 def db_specifics @db_specifics end |
#object_name ⇒ Object (readonly)
Returns the value of attribute object_name.
229 230 231 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 229 def object_name @object_name end |
Instance Method Details
#deserialize(yaml_node) ⇒ Object
231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 231 def deserialize(yaml_node) data = yaml_node.to_ruby if klass = ImpdeclMigrationAdder.support_type(yaml_node.tag) klass.new(@object_name, data).extend(@db_specifics) else if data.respond_to? :name= data.name = @object_name elsif data.kind_of? Hash data['name'] = @object_name end data end end |