Module: Loaderio::Configuration
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/loaderio/configuration.rb', line 5 def api_key @api_key end |
#api_version ⇒ Object
Returns the value of attribute api_version.
5 6 7 |
# File 'lib/loaderio/configuration.rb', line 5 def api_version @api_version end |
#protocol ⇒ Object
Returns the value of attribute protocol.
5 6 7 |
# File 'lib/loaderio/configuration.rb', line 5 def protocol @protocol end |
Instance Method Details
#base_url ⇒ Object
15 16 17 |
# File 'lib/loaderio/configuration.rb', line 15 def base_url "#{protocol}://#{server}/#{api_version}" end |
#resource ⇒ Object
19 20 21 |
# File 'lib/loaderio/configuration.rb', line 19 def resource @resource ||= RestClient::Resource.new(base_url, headers: {"loaderio-Auth" => api_key, content_type: :json, accept: :json }) end |
#server ⇒ Object
11 12 13 |
# File 'lib/loaderio/configuration.rb', line 11 def server "api.loader.io" end |