Class: Flydata::Api::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/api/base.rb

Direct Known Subclasses

Agent, DataEntry, DataPort, RedshiftCluster

Instance Method Summary collapse

Constructor Details

#initialize(api_client) ⇒ Base

Returns a new instance of Base.


4
5
6
# File 'lib/flydata/api/base.rb', line 4

def initialize(api_client)
  @client = api_client
end

Instance Method Details

#create(params = {}) ⇒ Object


10
11
12
13
# File 'lib/flydata/api/base.rb', line 10

def create(params={})
  params.each {|k, v| @url_path.gsub!(/:#{k}/, v.to_s)}
  @client.post(@url_path, nil, @model_name => params)
end

#list(params = {}) ⇒ Object


7
8
9
# File 'lib/flydata/api/base.rb', line 7

def list(params={})
  @client.get(@url_path)
end