class Pina::Configuration

Attributes

api_host[RW]
api_token[RW]
api_version[R]
base_url[W]
default_per_page[RW]
email[RW]
tenant[RW]
use_ssl[RW]

Public Class Methods

new() click to toggle source
# File lib/pina.rb, line 55
def initialize
  set_defaults
end

Public Instance Methods

base_url() click to toggle source
# File lib/pina.rb, line 77
def base_url
  @base_url = schema + tenant_formatted + api_host + '/api/' + "#{api_version}/"
end
schema() click to toggle source
# File lib/pina.rb, line 69
def schema
  use_ssl ? 'https://' : 'http://'
end
set_defaults() click to toggle source
# File lib/pina.rb, line 59
def set_defaults
  @api_version = DEFAULT_API_VERSION
  @email       = DEFAULT_EMAIL
  @tenant      = DEFAULT_TENANT
  @api_host    = API_HOST
  @default_per_page = nil
  @use_ssl     = true
  @base_url    = nil
end
tenant_formatted() click to toggle source
# File lib/pina.rb, line 73
def tenant_formatted
  @tenant.blank? ? '' : @tenant + '.'
end