Class: BandwidthIris::TnReservation
- Inherits:
-
Object
- Object
- BandwidthIris::TnReservation
show all
- Extended by:
- ClientWrapper
- Includes:
- ApiItem
- Defined in:
- lib/bandwidth-iris/tn_reservation.rb
Class Method Summary
collapse
Instance Method Summary
collapse
wrap_client_arg
Methods included from ApiItem
#[], #[]=, #initialize, #to_data
Class Method Details
.create(client, number) ⇒ Object
16
17
18
19
20
21
|
# File 'lib/bandwidth-iris/tn_reservation.rb', line 16
def self.create(client, number)
reservation_request = {:reservation => {:reserved_tn => number } }
location = client.make_request(:post, client.concat_account_path(TN_RESERVATION_PATH), reservation_request)[1][:location]
id = Client.(location)
self.get(client, id)
end
|
.get(client, id) ⇒ Object
9
10
11
12
13
|
# File 'lib/bandwidth-iris/tn_reservation.rb', line 9
def self.get(client, id)
data = client.make_request(:get, "#{client.concat_account_path(TN_RESERVATION_PATH)}/#{id}")[0][:reservation]
data[:id] = id
TnReservation.new(data, client)
end
|
Instance Method Details
#delete ⇒ Object
24
25
26
|
# File 'lib/bandwidth-iris/tn_reservation.rb', line 24
def delete()
@client.make_request(:delete,"#{@client.concat_account_path(TN_RESERVATION_PATH)}/#{id}")
end
|