Class: Karaden::Config

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

Constant Summary collapse

VERSION =
'1.2.0'.freeze
DEFAULT_API_BASE =
'https://prg.karaden.jp/api'.freeze
DEFALUT_API_VERSION =
'2024-03-01'.freeze
@@http_client =
nil
@@logger =
nil
@@formatter =
nil
@@api_version =
DEFALUT_API_VERSION
@@api_key =
nil
@@tenant_id =
nil
@@user_agent =
nil
@@api_base =
DEFAULT_API_BASE

Class Method Summary collapse

Class Method Details

.api_baseObject



16
17
18
# File 'lib/karaden/config.rb', line 16

def self.api_base
  @@api_base
end

.api_base=(val) ⇒ Object



20
21
22
# File 'lib/karaden/config.rb', line 20

def self.api_base=(val)
  @@api_base = val
end

.api_keyObject



24
25
26
# File 'lib/karaden/config.rb', line 24

def self.api_key
  @@api_key
end

.api_key=(val) ⇒ Object



28
29
30
# File 'lib/karaden/config.rb', line 28

def self.api_key=(val)
  @@api_key = val
end

.api_versionObject



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

def self.api_version
  @@api_version
end

.api_version=(val) ⇒ Object



36
37
38
# File 'lib/karaden/config.rb', line 36

def self.api_version=(val)
  @@api_version = val
end

.as_request_optionsObject



67
68
69
70
71
72
73
74
75
76
# File 'lib/karaden/config.rb', line 67

def self.as_request_options
  RequestOptions
  .new_builder
  .with_api_version(@@api_version)
  .with_api_key(@@api_key)
  .with_tenant_id(@@tenant_id)
  .with_user_agent(@@user_agent)
  .with_api_base(@@api_base)
  .build
end

.resetObject



56
57
58
59
60
61
62
63
64
65
# File 'lib/karaden/config.rb', line 56

def self.reset
  @@api_base = DEFAULT_API_BASE
  @@api_key = nil
  @@api_version = DEFALUT_API_VERSION
  @@tenant_id = nil
  @@user_agent = nil
  @@http_client = nil
  @@logger = nil
  @@formatter = nil
end

.tenant_idObject



40
41
42
# File 'lib/karaden/config.rb', line 40

def self.tenant_id
  @@tenant_id
end

.tenant_id=(val) ⇒ Object



44
45
46
# File 'lib/karaden/config.rb', line 44

def self.tenant_id=(val)
  @@tenant_id = val
end

.user_agentObject



48
49
50
# File 'lib/karaden/config.rb', line 48

def self.user_agent
  @@user_agent
end

.user_agent=(val) ⇒ Object



52
53
54
# File 'lib/karaden/config.rb', line 52

def self.user_agent=(val)
  @@user_agent = val
end