Class: PortaText::Command::Api::Tariffs

Inherits:
Base
  • Object
show all
Defined in:
lib/portatext/command/api/tariffs.rb

Overview

The tariffs endpoint. github.com/PortaText/docs/wiki/REST-API#api_tariffs

Author

Marcelo Gornstein ([email protected])

Copyright

Copyright © 2015 PortaText

License

Apache-2.0

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#accept_content_type, #body, #content_type, #delete, #get, #initialize, #patch, #post, #put, #set

Constructor Details

This class inherits a constructor from PortaText::Command::Base

Instance Method Details

#endpoint(_method) ⇒ Object



15
16
17
18
19
20
# File 'lib/portatext/command/api/tariffs.rb', line 15

def endpoint(_method)
  return 'tariffs' if @args[:country].nil?
  country = @args[:country]
  @args.delete :country
  "tariffs/#{country}"
end

#for_country(country_iso) ⇒ Object



11
12
13
# File 'lib/portatext/command/api/tariffs.rb', line 11

def for_country(country_iso)
  set :country, country_iso
end