Class: Valkyrie::Persistence::Postgres::ORMConverter
- Inherits:
-
Object
- Object
- Valkyrie::Persistence::Postgres::ORMConverter
- Defined in:
- lib/valkyrie/persistence/postgres/orm_converter.rb
Overview
Responsible for converting a Valkyrie::Persistence::Postgres::ORM::Resource to a Resource
Defined Under Namespace
Classes: RDFMetadata
Instance Attribute Summary collapse
-
#orm_object ⇒ Object
readonly
Returns the value of attribute orm_object.
-
#resource_factory ⇒ Object
readonly
Returns the value of attribute resource_factory.
Instance Method Summary collapse
-
#convert! ⇒ Valkyrie::Resource
Create a new instance of the class described in attributes and send it all the attributes that @orm_object has.
-
#initialize(orm_object, resource_factory:) ⇒ ORMConverter
constructor
A new instance of ORMConverter.
Constructor Details
#initialize(orm_object, resource_factory:) ⇒ ORMConverter
Returns a new instance of ORMConverter.
10 11 12 13 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 10 def initialize(orm_object, resource_factory:) @orm_object = orm_object @resource_factory = resource_factory end |
Instance Attribute Details
#orm_object ⇒ Object (readonly)
Returns the value of attribute orm_object.
6 7 8 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 6 def orm_object @orm_object end |
#resource_factory ⇒ Object (readonly)
Returns the value of attribute resource_factory.
6 7 8 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 6 def resource_factory @resource_factory end |
Instance Method Details
#convert! ⇒ Valkyrie::Resource
Create a new instance of the class described in attributes and send it all the attributes that @orm_object has
18 19 20 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 18 def convert! @resource ||= resource end |