Class: Marmotta::Resource
- Inherits:
-
Object
- Object
- Marmotta::Resource
- Defined in:
- lib/marmotta/resource.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#subject_uri ⇒ Object
readonly
Returns the value of attribute subject_uri.
Instance Method Summary collapse
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(subject_uri, connection:) ⇒ Resource
constructor
A new instance of Resource.
- #post(graph) ⇒ Object
Constructor Details
#initialize(subject_uri, connection:) ⇒ Resource
Returns a new instance of Resource.
4 5 6 7 |
# File 'lib/marmotta/resource.rb', line 4 def initialize(subject_uri, connection:) @subject_uri = subject_uri @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/marmotta/resource.rb', line 3 def connection @connection end |
#subject_uri ⇒ Object (readonly)
Returns the value of attribute subject_uri.
3 4 5 |
# File 'lib/marmotta/resource.rb', line 3 def subject_uri @subject_uri end |
Instance Method Details
#delete ⇒ Object
9 10 11 |
# File 'lib/marmotta/resource.rb', line 9 def delete connection.delete(subject_uri) end |
#get ⇒ Object
13 14 15 |
# File 'lib/marmotta/resource.rb', line 13 def get connection.get(subject_uri) end |
#post(graph) ⇒ Object
17 18 19 |
# File 'lib/marmotta/resource.rb', line 17 def post(graph) connection.post(graph) end |