Class: Valkyrie::Sequel::ResourceFactory::ResourceConverter
- Inherits:
-
Object
- Object
- Valkyrie::Sequel::ResourceFactory::ResourceConverter
- Defined in:
- lib/valkyrie/sequel/resource_factory/resource_converter.rb
Constant Summary collapse
- PRIMARY_TERMS =
[ :id, :created_at, :updated_at, :internal_resource ].freeze
- DISALLOWED_TERMS =
[ :new_record ].freeze
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#resource_factory ⇒ Object
readonly
Returns the value of attribute resource_factory.
Instance Method Summary collapse
- #convert! ⇒ Object
-
#initialize(resource, resource_factory:) ⇒ ResourceConverter
constructor
A new instance of ResourceConverter.
Constructor Details
#initialize(resource, resource_factory:) ⇒ ResourceConverter
Returns a new instance of ResourceConverter.
18 19 20 21 |
# File 'lib/valkyrie/sequel/resource_factory/resource_converter.rb', line 18 def initialize(resource, resource_factory:) @resource = resource @resource_factory = resource_factory end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
15 16 17 |
# File 'lib/valkyrie/sequel/resource_factory/resource_converter.rb', line 15 def resource @resource end |
#resource_factory ⇒ Object (readonly)
Returns the value of attribute resource_factory.
15 16 17 |
# File 'lib/valkyrie/sequel/resource_factory/resource_converter.rb', line 15 def resource_factory @resource_factory end |
Instance Method Details
#convert! ⇒ Object
23 24 25 26 27 28 |
# File 'lib/valkyrie/sequel/resource_factory/resource_converter.rb', line 23 def convert! output = database_hash output[:id] = resource.id.to_s if resource.id process_lock_token(output) output end |