Class: CivicSIPSdk::AppConfig
- Inherits:
-
Object
- Object
- CivicSIPSdk::AppConfig
- Defined in:
- lib/civic_sip_sdk/app_config.rb
Constant Summary collapse
- VALID_ENVS =
%i[dev prod].freeze
- REQUIRED_KEYS =
[ { name: :id, error: 'Civic application id is missing!' }, { name: :private_key, error: 'Civic application private signing key is missing!' }, { name: :secret, error: 'Civic application secret is missing!' } ].freeze
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
Instance Method Summary collapse
-
#initialize(id:, env:, private_key:, secret:) ⇒ AppConfig
constructor
Creates a new instance of
CivicSIPSdk::AppConfig
.
Constructor Details
#initialize(id:, env:, private_key:, secret:) ⇒ AppConfig
Creates a new instance of CivicSIPSdk::AppConfig
. This is used to configure the SDK connection parameters to the Civic SIP service.
It raises an ArgumentError if any argument is nil.
23 24 25 26 27 28 29 30 |
# File 'lib/civic_sip_sdk/app_config.rb', line 23 def initialize(id:, env:, private_key:, secret:) @id = id @env = VALID_ENVS.include?(env.to_sym) ? env.to_sym : VALID_ENVS.last @private_key = private_key @secret = secret validate end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
5 6 7 |
# File 'lib/civic_sip_sdk/app_config.rb', line 5 def env @env end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/civic_sip_sdk/app_config.rb', line 5 def id @id end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
5 6 7 |
# File 'lib/civic_sip_sdk/app_config.rb', line 5 def private_key @private_key end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
5 6 7 |
# File 'lib/civic_sip_sdk/app_config.rb', line 5 def secret @secret end |