Class: CleverTap::Config
- Inherits:
-
Object
- Object
- CleverTap::Config
- Defined in:
- lib/clever_tap/config.rb
Overview
CleverTap instance’s config store object
Constant Summary collapse
- DEFAULT_IDENTITY_FIELD =
'identity'.freeze
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#identity_field ⇒ Object
Returns the value of attribute identity_field.
-
#passcode ⇒ Object
Returns the value of attribute passcode.
Instance Method Summary collapse
-
#configure_faraday(&block) ⇒ Object
NOTE: reader or writer depending if the block is given.
-
#initialize(**config) ⇒ Config
constructor
A new instance of Config.
- #validate ⇒ Object
Constructor Details
#initialize(**config) ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 |
# File 'lib/clever_tap/config.rb', line 8 def initialize(**config) @account_id = config[:account_id] @passcode = config[:passcode] @identity_field = config[:identity_field] || DEFAULT_IDENTITY_FIELD @configure_faraday = config[:configure_faraday] end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
6 7 8 |
# File 'lib/clever_tap/config.rb', line 6 def account_id @account_id end |
#identity_field ⇒ Object
Returns the value of attribute identity_field.
6 7 8 |
# File 'lib/clever_tap/config.rb', line 6 def identity_field @identity_field end |
#passcode ⇒ Object
Returns the value of attribute passcode.
6 7 8 |
# File 'lib/clever_tap/config.rb', line 6 def passcode @passcode end |
Instance Method Details
#configure_faraday(&block) ⇒ Object
NOTE: reader or writer depending if the block is given
16 17 18 |
# File 'lib/clever_tap/config.rb', line 16 def configure_faraday(&block) block ? @configure_faraday = block : @configure_faraday end |
#validate ⇒ Object
20 21 22 23 |
# File 'lib/clever_tap/config.rb', line 20 def validate raise 'Missing authentication parameter `account_id`' unless account_id raise 'Missing authentication parameter `passcode`' unless passcode end |