Class: HyperGraphObject

Inherits:
Object
  • Object
show all
Defined in:
lib/hyper_graph_object.rb

Instance Method Summary collapse

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, options={})
  request = @id.to_s
  request += "/#{connection.to_s}" if connection
  @graph.delete(request, options)
end

#get(connection = nil, options = {}) ⇒ Object



8
9
10
11
12
# File 'lib/hyper_graph_object.rb', line 8

def get(connection=nil, options={})
  request = @id.to_s
  request += "/#{connection.to_s}" if connection
  @graph.get(request, options)
end

#post(connection = nil, options = {}) ⇒ Object



14
15
16
17
18
# File 'lib/hyper_graph_object.rb', line 14

def post(connection=nil, options={})
  request = @id.to_s
  request += "/#{connection.to_s}" if connection
  @graph.post(request, options)
end