Class: ClickAndSend::Configuration
- Inherits:
-
Object
- Object
- ClickAndSend::Configuration
- Defined in:
- lib/click_and_send/configuration.rb
Constant Summary collapse
- ATTRIBUTES =
[:account_number, :api_version, :api_key, :logfile, :logger, :user_name, :wsdl]
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 |
# File 'lib/click_and_send/configuration.rb', line 6 def initialize @api_version = 10 end |
Instance Method Details
#errors ⇒ Object
10 11 12 13 14 |
# File 'lib/click_and_send/configuration.rb', line 10 def errors Hash[(ATTRIBUTES - optional_attributes).collect do |attribute| [attribute, ("is required" if send(attribute).nil?)] end] end |
#valid? ⇒ Boolean
16 17 18 |
# File 'lib/click_and_send/configuration.rb', line 16 def valid? errors.values.compact.empty? end |