Class: Tinypass::Config

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

Constant Summary collapse

VERSION =
"2.0.7"
MSG_VERSION =
"2.0p"
CONTEXT =
"/v2"
REST_CONTEXT =
"/r2"
"__TP_"
"_TOKEN"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#aidObject

Returns the value of attribute aid.



32
33
34
# File 'lib/tinypass.rb', line 32

def aid
  @aid
end

#private_keyObject

Returns the value of attribute private_key.



32
33
34
# File 'lib/tinypass.rb', line 32

def private_key
  @private_key
end

#sandboxObject

Returns the value of attribute sandbox.



32
33
34
# File 'lib/tinypass.rb', line 32

def sandbox
  @sandbox
end

Class Method Details

.app_prefix(aid) ⇒ Object



34
35
36
# File 'lib/tinypass.rb', line 34

def self.app_prefix(aid)
  COOKIE_PREFIX + aid
end

.endpointObject



42
43
44
45
46
# File 'lib/tinypass.rb', line 42

def self.endpoint
  return Tinypass::API_ENDPOINT_DEV if defined?(Tinypass::API_ENDPOINT_DEV)

  Tinypass.sandbox ? Tinypass::API_ENDPOINT_SANDBOX :  Tinypass::API_ENDPOINT_PROD
end


38
39
40
# File 'lib/tinypass.rb', line 38

def self.token_cookie_name(aid = Tinypass::aid)
  COOKIE_PREFIX + aid + COOKIE_SUFFIX
end