Class: ClickAndSend::Configuration

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeConfiguration

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

#errorsObject



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

Returns:

  • (Boolean)


16
17
18
# File 'lib/click_and_send/configuration.rb', line 16

def valid?
  errors.values.compact.empty?
end