Class: ActiveFedora::LdpResourceService
- Inherits:
-
Object
- Object
- ActiveFedora::LdpResourceService
- Defined in:
- lib/active_fedora/ldp_resource_service.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #build(klass, id) ⇒ Object
-
#initialize(conn) ⇒ LdpResourceService
constructor
A new instance of LdpResourceService.
- #update(change_set, klass, id) ⇒ Object
Constructor Details
#initialize(conn) ⇒ LdpResourceService
Returns a new instance of LdpResourceService.
5 6 7 |
# File 'lib/active_fedora/ldp_resource_service.rb', line 5 def initialize(conn) @connection = conn end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/active_fedora/ldp_resource_service.rb', line 3 def connection @connection end |
Instance Method Details
#build(klass, id) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/active_fedora/ldp_resource_service.rb', line 9 def build(klass, id) if id LdpResource.new(connection, to_uri(klass, id)) else LdpResource.new(connection, nil, nil, ActiveFedora.fedora.host + ActiveFedora.fedora.base_path) end end |
#update(change_set, klass, id) ⇒ Object
17 18 19 |
# File 'lib/active_fedora/ldp_resource_service.rb', line 17 def update(change_set, klass, id) SparqlInsert.new(change_set.changes).execute(to_uri(klass, id)) end |