Class: Johac::Client

Inherits:
Object
  • Object
show all
Includes:
Connection
Defined in:
lib/johac/client.rb

Overview

Base class for Johac API Client.

Extend this class and provide API specific calls

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = nil) ⇒ Client

Returns a new instance of Client.

Parameters:



18
19
20
# File 'lib/johac/client.rb', line 18

def initialize(config=nil)
  @config = Johac.merged_config(config)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



8
9
10
# File 'lib/johac/client.rb', line 8

def config
  @config
end

Instance Method Details

#envString

Reference to the current environment. Set explicitly in Johac.configure or via environment variables JOHAC_ENV or RAILS_ENV.

Returns:

  • (String)

    One of “testing”, “development”, or “production”



33
34
35
# File 'lib/johac/client.rb', line 33

def env
  config.env
end

#uriString

Reference to base_uri set on Johac.config in Johac.configure or in the constructor.

Returns:

  • (String)


25
26
27
# File 'lib/johac/client.rb', line 25

def uri
  config.base_uri
end