Class: IContact::Configuration
- Inherits:
-
Object
- Object
- IContact::Configuration
- Defined in:
- lib/i_contact/configuration.rb
Constant Summary collapse
- REQUIRED_FIELDS =
[ :app_id, :user_name, :password, ]
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#client_folder_id ⇒ Object
Returns the value of attribute client_folder_id.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#password ⇒ Object
Returns the value of attribute password.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 |
# File 'lib/i_contact/configuration.rb', line 17 def initialize(&block) yield(self) if block_given? @mode ||= :sandbox @api_version || '2.2' end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/i_contact/configuration.rb', line 8 def account_id @account_id end |
#api_version ⇒ Object
Returns the value of attribute api_version.
6 7 8 |
# File 'lib/i_contact/configuration.rb', line 6 def api_version @api_version end |
#app_id ⇒ Object
Returns the value of attribute app_id.
3 4 5 |
# File 'lib/i_contact/configuration.rb', line 3 def app_id @app_id end |
#client_folder_id ⇒ Object
Returns the value of attribute client_folder_id.
9 10 11 |
# File 'lib/i_contact/configuration.rb', line 9 def client_folder_id @client_folder_id end |
#mode ⇒ Object
Returns the value of attribute mode.
7 8 9 |
# File 'lib/i_contact/configuration.rb', line 7 def mode @mode end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/i_contact/configuration.rb', line 5 def password @password end |
#user_name ⇒ Object
Returns the value of attribute user_name.
4 5 6 |
# File 'lib/i_contact/configuration.rb', line 4 def user_name @user_name end |
Instance Method Details
#valid? ⇒ Boolean
23 24 25 26 27 28 |
# File 'lib/i_contact/configuration.rb', line 23 def valid? REQUIRED_FIELDS.each do |field| return false if send(field).nil? || send(field) == '' end true end |