Class: FedexRateGetter::Rate
- Inherits:
-
Object
- Object
- FedexRateGetter::Rate
- Defined in:
- lib/fedex_rate_getter.rb
Instance Attribute Summary collapse
-
#something ⇒ Object
Returns the value of attribute something.
Class Method Summary collapse
-
.get(credentials, quote_params) ⇒ Array
Main method.
Instance Method Summary collapse
-
#initialize ⇒ Rate
constructor
A new instance of Rate.
Constructor Details
#initialize ⇒ Rate
Returns a new instance of Rate.
10 11 12 |
# File 'lib/fedex_rate_getter.rb', line 10 def initialize @something = 'hola mundo' end |
Instance Attribute Details
#something ⇒ Object
Returns the value of attribute something.
8 9 10 |
# File 'lib/fedex_rate_getter.rb', line 8 def something @something end |
Class Method Details
.get(credentials, quote_params) ⇒ Array
Main method. returns shipping rate
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fedex_rate_getter.rb', line 17 def self.get(credentials, quote_params) # enable the api connection connection = FedexRateGetter::Connection.new # format body body = FedexRateGetter::Formatter::Body.new(credentials, quote_params).body # make a call to the api res = connection.get_rates(body) # return FedexRateGetter::Formatter::Response.new(res.body).response end |