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.
225 226 227 228 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 225 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.
230 231 232 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 230 def db_specifics @db_specifics end |
#object_name ⇒ Object (readonly)
Returns the value of attribute object_name.
230 231 232 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 230 def object_name @object_name end |
Instance Method Details
#deserialize(yaml_node) ⇒ Object
232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/xmigra/impdecl_migration_adder.rb', line 232 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 |