Class: ActiveFedora::LoadableFromJson::SolrBackedResource::FakeQuery
- Inherits:
-
Object
- Object
- ActiveFedora::LoadableFromJson::SolrBackedResource::FakeQuery
- Includes:
- Enumerable
- Defined in:
- lib/active_fedora/loadable_from_json.rb
Overview
FakeQuery exists to adapt the hash to the RDF interface used by RDF associations in ActiveFedora
Defined Under Namespace
Classes: FakeStatement
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #enum_statement ⇒ Object
-
#initialize(values) ⇒ FakeQuery
constructor
A new instance of FakeQuery.
- #objects ⇒ Object
Constructor Details
#initialize(values) ⇒ FakeQuery
Returns a new instance of FakeQuery.
61 62 63 |
# File 'lib/active_fedora/loadable_from_json.rb', line 61 def initialize(values) @values = values || [] end |
Instance Method Details
#each(&block) ⇒ Object
65 66 67 |
# File 'lib/active_fedora/loadable_from_json.rb', line 65 def each(&block) enum_statement.each(&block) end |
#enum_statement ⇒ Object
69 70 71 |
# File 'lib/active_fedora/loadable_from_json.rb', line 69 def enum_statement @values.map { |v| FakeStatement.new(v) } end |
#objects ⇒ Object
73 74 75 |
# File 'lib/active_fedora/loadable_from_json.rb', line 73 def objects @values end |