Class: Hydra::ContentNegotiation::CleanGraphRepository
- Inherits:
-
Object
- Object
- Hydra::ContentNegotiation::CleanGraphRepository
- Defined in:
- app/models/hydra/content_negotiation/clean_graph_repository.rb
Overview
CleanGraphRepository has a #find interface which returns a graph for use with content negotiation.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#replacer ⇒ Object
readonly
Returns the value of attribute replacer.
Instance Method Summary collapse
- #find(id) ⇒ Object
-
#initialize(connection, replacer = Hydra.config.id_to_resource_uri) ⇒ CleanGraphRepository
constructor
A new instance of CleanGraphRepository.
Constructor Details
#initialize(connection, replacer = Hydra.config.id_to_resource_uri) ⇒ CleanGraphRepository
Returns a new instance of CleanGraphRepository.
8 9 10 11 |
# File 'app/models/hydra/content_negotiation/clean_graph_repository.rb', line 8 def initialize(connection, replacer = Hydra.config.id_to_resource_uri) @connection = connection @replacer = replacer end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
5 6 7 |
# File 'app/models/hydra/content_negotiation/clean_graph_repository.rb', line 5 def connection @connection end |
#replacer ⇒ Object (readonly)
Returns the value of attribute replacer.
5 6 7 |
# File 'app/models/hydra/content_negotiation/clean_graph_repository.rb', line 5 def replacer @replacer end |
Instance Method Details
#find(id) ⇒ Object
13 14 15 16 17 18 |
# File 'app/models/hydra/content_negotiation/clean_graph_repository.rb', line 13 def find(id) ReplacingGraphFinder.new( GraphFinder.new(connection, id), replacer ).graph end |