Class: Hydra::ContentNegotiation::GraphFinder

Inherits:
Object
  • Object
show all
Defined in:
app/models/hydra/content_negotiation/graph_finder.rb

Overview

Finds a graph given a connection and ID.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, id) ⇒ GraphFinder

Returns a new instance of GraphFinder.



5
6
7
8
# File 'app/models/hydra/content_negotiation/graph_finder.rb', line 5

def initialize(connection, id)
  @connection = connection
  @id = id
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



4
5
6
# File 'app/models/hydra/content_negotiation/graph_finder.rb', line 4

def connection
  @connection
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'app/models/hydra/content_negotiation/graph_finder.rb', line 4

def id
  @id
end

Instance Method Details

#graphObject



10
11
12
# File 'app/models/hydra/content_negotiation/graph_finder.rb', line 10

def graph
  connection.get(uri).graph
end

#uriObject



14
15
16
# File 'app/models/hydra/content_negotiation/graph_finder.rb', line 14

def uri
  ActiveFedora::Base.id_to_uri(id)
end