Class: HyperGraphObject
- Inherits:
-
Object
- Object
- HyperGraphObject
- Defined in:
- lib/hyper_graph_object.rb
Instance Method Summary collapse
- #delete(connection = nil, options = {}) ⇒ Object
- #get(connection = nil, options = {}) ⇒ Object
-
#initialize(graph, id) ⇒ HyperGraphObject
constructor
A new instance of HyperGraphObject.
- #post(connection = nil, options = {}) ⇒ Object
Constructor Details
#initialize(graph, id) ⇒ HyperGraphObject
Returns a new instance of HyperGraphObject.
3 4 5 6 |
# File 'lib/hyper_graph_object.rb', line 3 def initialize(graph, id) @graph = graph @id = id end |
Instance Method Details
#delete(connection = nil, options = {}) ⇒ Object
20 21 22 23 24 |
# File 'lib/hyper_graph_object.rb', line 20 def delete(connection=nil, ={}) request = @id.to_s request += "/#{connection.to_s}" if connection @graph.delete(request, ) end |
#get(connection = nil, options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/hyper_graph_object.rb', line 8 def get(connection=nil, ={}) request = @id.to_s request += "/#{connection.to_s}" if connection @graph.get(request, ) end |
#post(connection = nil, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/hyper_graph_object.rb', line 14 def post(connection=nil, ={}) request = @id.to_s request += "/#{connection.to_s}" if connection @graph.post(request, ) end |