Class: Hydra::ContentNegotiation::GraphFinder
- Inherits:
-
Object
- Object
- Hydra::ContentNegotiation::GraphFinder
- Defined in:
- app/models/hydra/content_negotiation/graph_finder.rb
Overview
Finds a graph given a connection and ID.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #graph ⇒ Object
-
#initialize(connection, id) ⇒ GraphFinder
constructor
A new instance of GraphFinder.
- #uri ⇒ Object
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
#connection ⇒ Object (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 |
#id ⇒ Object (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
#graph ⇒ Object
10 11 12 |
# File 'app/models/hydra/content_negotiation/graph_finder.rb', line 10 def graph connection.get(uri).graph end |
#uri ⇒ Object
14 15 16 |
# File 'app/models/hydra/content_negotiation/graph_finder.rb', line 14 def uri ActiveFedora::Base.id_to_uri(id) end |