Class: Johac::Client
Overview
Base class for Johac API Client.
Extend this class and provide API specific calls
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#env ⇒ String
Reference to the current environment.
-
#initialize(config = nil) ⇒ Client
constructor
A new instance of Client.
-
#uri ⇒ String
Reference to
base_uriset on config in configure or in the constructor.
Constructor Details
#initialize(config = nil) ⇒ Client
Returns a new instance of Client.
18 19 20 |
# File 'lib/johac/client.rb', line 18 def initialize(config=nil) @config = Johac.merged_config(config) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/johac/client.rb', line 8 def config @config end |
Instance Method Details
#env ⇒ String
Reference to the current environment. Set explicitly in Johac.configure or via environment variables JOHAC_ENV or RAILS_ENV.
33 34 35 |
# File 'lib/johac/client.rb', line 33 def env config.env end |
#uri ⇒ String
Reference to base_uri set on Johac.config in Johac.configure or in the constructor.
25 26 27 |
# File 'lib/johac/client.rb', line 25 def uri config.base_uri end |