Class: ActiveFedora::LoadableFromJson::SolrBackedResource::FakeQuery

Inherits:
Object
  • Object
show all
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

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_statementObject



69
70
71
# File 'lib/active_fedora/loadable_from_json.rb', line 69

def enum_statement
  @values.map { |v| FakeStatement.new(v) }
end

#objectsObject



73
74
75
# File 'lib/active_fedora/loadable_from_json.rb', line 73

def objects
  @values
end