Class: VoiceML::PricingCountriesResource

Inherits:
Object
  • Object
show all
Defined in:
lib/voiceml/resources/pricing.rb

Overview

.../Countries list + per-country fetch. model is the fetch body class.

Instance Method Summary collapse

Constructor Details

#initialize(transport, base_path, model) ⇒ PricingCountriesResource

Returns a new instance of PricingCountriesResource.



45
46
47
48
49
# File 'lib/voiceml/resources/pricing.rb', line 45

def initialize(transport, base_path, model)
  @transport = transport
  @base      = base_path
  @model     = model
end

Instance Method Details

#fetch(iso_country) ⇒ Object



57
58
59
# File 'lib/voiceml/resources/pricing.rb', line 57

def fetch(iso_country)
  @model.from_hash(@transport.request(:get, "#{@base}/#{iso_country}"))
end

#list(page_size: nil) ⇒ Object



51
52
53
54
55
# File 'lib/voiceml/resources/pricing.rb', line 51

def list(page_size: nil)
  params = {}
  params['PageSize'] = page_size unless page_size.nil?
  PricingCountriesList.new(@transport.request(:get, @base, params: params))
end