Class: Flukso::API

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/flukso/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, base_url) ⇒ API

Returns a new instance of API.



63
64
65
66
# File 'lib/flukso/api.rb', line 63

def initialize(client, base_url)
  @client = client
  @base_url = base_url
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



61
62
63
# File 'lib/flukso/api.rb', line 61

def client
  @client
end

Instance Method Details

#perform_delete(path, options = {}) ⇒ Object



80
81
82
# File 'lib/flukso/api.rb', line 80

def perform_delete(path, options={})
  Flukso::Request.delete(self, @base_url+path, add_version_header(options))
end

#perform_get(path, options = {}) ⇒ Object



68
69
70
# File 'lib/flukso/api.rb', line 68

def perform_get(path, options={})
  Flukso::Request.get(self, @base_url+path, options )
end

#perform_post(path, options = {}) ⇒ Object



72
73
74
# File 'lib/flukso/api.rb', line 72

def perform_post(path, options={})
  Flukso::Request.post(self, @base_url+path, add_version_header(options))
end

#perform_put(path, options = {}) ⇒ Object



76
77
78
# File 'lib/flukso/api.rb', line 76

def perform_put(path, options={})
  Flukso::Request.put(self, @base_url+path, add_version_header(options))
end