Class: FedexRateGetter::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/fedex_rate_getter/connection.rb

Constant Summary collapse

API_URL =
'https://wsbeta.fedex.com:443/xml'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConnection

Returns a new instance of Connection.



9
10
11
# File 'lib/fedex_rate_getter/connection.rb', line 9

def initialize
	@api_connection = Faraday.new(API_URL)
end

Instance Attribute Details

#api_connectionObject

Returns the value of attribute api_connection.



7
8
9
# File 'lib/fedex_rate_getter/connection.rb', line 7

def api_connection
  @api_connection
end

Instance Method Details

#get_rates(body) ⇒ Object



13
14
15
# File 'lib/fedex_rate_getter/connection.rb', line 13

def get_rates(body)
	api_connection.post(API_URL, body, 'Content-Type' => 'application/xml')
end