Class: Lce::Client
- Inherits:
-
Object
- Object
- Lce::Client
- Includes:
- Connection, Errors, Request
- Defined in:
- lib/lce/client.rb,
lib/lce/client/errors.rb,
lib/lce/client/request.rb,
lib/lce/client/connection.rb
Defined Under Namespace
Modules: Connection, Errors, Request
Constant Summary collapse
- HOSTS =
{ development: "http://localhost:9000", staging: "https://test.myflyingbox.com", production: "https://api.myflyingbox.com" }
Instance Attribute Summary collapse
-
#http_adapter ⇒ Object
Returns the value of attribute http_adapter.
Instance Method Summary collapse
- #api_version ⇒ Object
- #host ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Methods included from Request
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
20 21 22 |
# File 'lib/lce/client.rb', line 20 def initialize @http_adapter = Lce.configuration.http_adapter end |
Instance Attribute Details
#http_adapter ⇒ Object
Returns the value of attribute http_adapter.
18 19 20 |
# File 'lib/lce/client.rb', line 18 def http_adapter @http_adapter end |
Instance Method Details
#api_version ⇒ Object
28 29 30 31 |
# File 'lib/lce/client.rb', line 28 def api_version raise VersionError.new("Wrong API version",' wrong_api_version', "Version must be 1 or 2.") unless [1, 2].include?(Lce.configuration.api_version) 'v'+Lce.configuration.api_version.to_s end |
#host ⇒ Object
24 25 26 |
# File 'lib/lce/client.rb', line 24 def host HOSTS[Lce.configuration.environment] end |