class Delhivery::Configuration

Attributes

api_key[RW]
production[RW]

Public Class Methods

new(opts = {}) click to toggle source
# File lib/delhivery/configuration.rb, line 5
def initialize(opts = {})
  @api_key = opts[:api_key]
  @production = opts[:production] || false
end

Public Instance Methods

validate() click to toggle source
# File lib/delhivery/configuration.rb, line 10
def validate
  errors = []
  errors << "Invalid API Key" if @api_key.nil? || @api_key.empty? 
  unless errors.empty?
    raise ArgumentError, "#{errors.join(', ')}"
  end
end