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.
-
#server ⇒ Object
Returns the value of attribute server.
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 |
#server ⇒ Object
Returns the value of attribute server.
5 6 7 |
# File 'lib/loaderio/configuration.rb', line 5 def server @server end |
Instance Method Details
#base_url ⇒ Object
12 13 14 |
# File 'lib/loaderio/configuration.rb', line 12 def base_url "#{protocol}://#{server}/#{api_version}" end |
#resource ⇒ Object
16 17 18 |
# File 'lib/loaderio/configuration.rb', line 16 def resource RestClient::Resource.new(base_url, headers: {"loaderio-Auth" => api_key, content_type: :json, accept: :json }) end |