Class: Tazworks::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/tazworks/config.rb

Overview

Tazworks Set Configuration

Constant Summary collapse

DEFAULT_SANDBOX_HOST =
'https://api-sandbox.instascreen.net'
DEFAULT_PRODUCTION_HOST =
'https://api.instascreen.net'
DEFAULT_PORT =
443

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



10
11
12
# File 'lib/tazworks/config.rb', line 10

def api_key
  @api_key
end

#hostObject

Returns the value of attribute host.



10
11
12
# File 'lib/tazworks/config.rb', line 10

def host
  @host
end

#portObject

Returns the value of attribute port.



10
11
12
# File 'lib/tazworks/config.rb', line 10

def port
  @port
end

#sandboxObject

Returns the value of attribute sandbox.



10
11
12
# File 'lib/tazworks/config.rb', line 10

def sandbox
  @sandbox
end

Instance Method Details

#base_uriObject



12
13
14
15
16
# File 'lib/tazworks/config.rb', line 12

def base_uri
  host = @host
  host ||= @sandbox ? DEFAULT_SANDBOX_HOST : DEFAULT_PRODUCTION_HOST
  URI.parse("#{host}:#{@port || DEFAULT_PORT}")
end