Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::OrderedProperties::NestedProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/valkyrie/persistence/fedora/persister/model_converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, scope:) ⇒ NestedProperty

Returns a new instance of NestedProperty.



260
261
262
263
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 260

def initialize(value:, scope:)
  @value = value
  @scope = scope
end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



259
260
261
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 259

def scope
  @scope
end

#valueObject (readonly)

Returns the value of attribute value.



259
260
261
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 259

def value
  @value
end

Instance Method Details

#keyObject



269
270
271
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 269

def key
  scope.key.to_s.singularize.to_sym
end

#nodeObject



273
274
275
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 273

def node
  @node ||= ::RDF::URI("##{::RDF::Node.new.id}")
end

#propertyObject



265
266
267
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 265

def property
  @property ||= Property.new(node, key, value, scope.adapter, scope.resource)
end