Class: WaCloudApi::Configuration
- Inherits:
-
Object
- Object
- WaCloudApi::Configuration
- Defined in:
- lib/wa_cloud_api/configuration.rb
Constant Summary collapse
- MANDATORY_ATTRIBUTES =
i[phone_number_id token].freeze
Instance Attribute Summary collapse
-
#phone_number_id ⇒ Object
Returns the value of attribute phone_number_id.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 |
# File 'lib/wa_cloud_api/configuration.rb', line 9 def initialize @missing_params = [] end |
Instance Attribute Details
#phone_number_id ⇒ Object
Returns the value of attribute phone_number_id.
5 6 7 |
# File 'lib/wa_cloud_api/configuration.rb', line 5 def phone_number_id @phone_number_id end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/wa_cloud_api/configuration.rb', line 5 def token @token end |
Instance Method Details
#valid? ⇒ Boolean
13 14 15 16 17 18 19 20 21 |
# File 'lib/wa_cloud_api/configuration.rb', line 13 def valid? MANDATORY_ATTRIBUTES.each do |attribute| @missing_params << attribute unless instance_variable_defined?("@#{attribute}") end raise ArgumentError, "#{@missing_params.join(', ')} are not set in configuration" unless @missing_params.empty? true end |