Class: Graphcommons::Endpoint

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

Overview

Wrapper for general methods in the API.

Class Method Summary collapse

Methods inherited from API

check_key, delete, get, post, put, set_key

Class Method Details

.delete_graph(id) ⇒ Object



220
221
222
# File 'lib/graphcommons.rb', line 220

def self.delete_graph id
  self.delete :graphs, :id => id
end

.get_graph(id) ⇒ Object



182
183
184
# File 'lib/graphcommons.rb', line 182

def self.get_graph id
  self.get :graphs, :id => id
end

.get_graph_edges(id, options) ⇒ Object

Get edges inside graph with :id.

graphcommons.github.io/api-v1/#get-graphs-id-edges



196
197
198
199
# File 'lib/graphcommons.rb', line 196

def self.get_graph_edges id, options
  options[:id] = id
  self.get "graphs/edges", options
end

.get_graph_paths(id, options) ⇒ Object



205
206
207
208
# File 'lib/graphcommons.rb', line 205

def self.get_graph_paths id, options
  options[:id] = id
  self.get "graphs/paths", options
end

.get_graph_types(id) ⇒ Object

Get node and edge types inside graph with :id.

graphcommons.github.io/api-v1/#get-graphs-id-types



189
190
191
# File 'lib/graphcommons.rb', line 189

def self.get_graph_types id
  self.get "graphs/types", :id => id
end

.get_hub(id) ⇒ Object



234
235
236
# File 'lib/graphcommons.rb', line 234

def self.get_hub id
  self.get :hubs, :id => id
end

.get_hub_graphs(id, options) ⇒ Object

Search for graphs inside hub with :id.

graphcommons.github.io/api-v1/#get-hubs-id-graphs



257
258
259
260
# File 'lib/graphcommons.rb', line 257

def self.get_hub_graphs id, options
  options[:id] = id
  self.get "graphs/search", options
end

.get_hub_nodes(id, options) ⇒ Object

Search for nodes inside hub with :id.

graphcommons.github.io/api-v1/#get-hubs-id-nodes



265
266
267
268
# File 'lib/graphcommons.rb', line 265

def self.get_hub_nodes id, options
  options[:id] = id
  self.get "nodes/search", options
end

.get_hub_paths(id, options) ⇒ Object



249
250
251
252
# File 'lib/graphcommons.rb', line 249

def self.get_hub_paths id, options
  options[:id] = id
  self.get "hubs/paths", options
end

.get_hub_types(id) ⇒ Object

Get node and edge types in hub with :id.

graphcommons.github.io/api-v1/#get-hubs-id-types



241
242
243
# File 'lib/graphcommons.rb', line 241

def self.get_hub_types id
  self.get "hubs/types", :id => id
end

.get_node(id) ⇒ Object



227
228
229
# File 'lib/graphcommons.rb', line 227

def self.get_node id
  self.get :nodes, :id => id
end

.new_graph(options) ⇒ Object

Create new graph. Required options: :name

graphcommons.github.io/api-v1/#post-graphs



175
176
177
# File 'lib/graphcommons.rb', line 175

def self.new_graph options
  self.post :graphs, options
end

.statusObject



167
168
169
# File 'lib/graphcommons.rb', line 167

def self.status
  self.get :status
end

.update_graph(id, options) ⇒ Object

Modify attributes of graph with :id.

graphcommons.github.io/api-v1/#put-graphs-id



213
214
215
# File 'lib/graphcommons.rb', line 213

def self.update_graph id, options
  self.put :graphs, :id => id, :graph=> options
end