class BandwidthIris::TnReservation

Public Class Methods

create(client, number) click to toggle source
# 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.get_id_from_location_header(location)
  self.get(client, id)
end
get(client, id) click to toggle source
# 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

Public Instance Methods

delete() click to toggle source
# File lib/bandwidth-iris/tn_reservation.rb, line 24
def delete()
  @client.make_request(:delete,"#{@client.concat_account_path(TN_RESERVATION_PATH)}/#{id}")
end