Class: BandwidthIris::Dlda
Class Method Summary
collapse
Instance Method Summary
collapse
wrap_client_arg
Methods included from ApiItem
#[], #[]=, #initialize, #to_data
Class Method Details
.create(client, item) ⇒ Object
26
27
28
29
30
|
# File 'lib/bandwidth-iris/dlda.rb', line 26
def self.create(client, item)
location = client.make_request(:post, client.concat_account_path(DLDA_PATH), {:dlda_order => item})[1][:location]
id = Client.(location)
self.get(client, id)
end
|
.get(client, id) ⇒ Object
19
20
21
22
23
|
# File 'lib/bandwidth-iris/dlda.rb', line 19
def self.get(client, id)
data = client.make_request(:get, "#{client.concat_account_path(DLDA_PATH)}/#{id}")[0]
data[:id] = data[:dlda_order][:order_id]
Dlda.new(data, client)
end
|
.list(client, query = nil) ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'lib/bandwidth-iris/dlda.rb', line 8
def self.list(client, query = nil)
list = client.make_request(:get, client.concat_account_path(DLDA_PATH), query)[0][:list_order_id_user_id_date][:order_id_user_id_date]
return [] if !list
list = if list.is_a?(Array) then list else [list] end
list.map do |i|
i[:id] = i[:order_id]
Dlda.new(i, client)
end
end
|
Instance Method Details
#get_history ⇒ Object
34
35
36
|
# File 'lib/bandwidth-iris/dlda.rb', line 34
def get_history()
@client.make_request(:get,"#{@client.concat_account_path(DLDA_PATH)}/#{id}/history")[0][:order_history]
end
|