Class: CanadaPost::Credentials

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/canada_post/credentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Credentials

Returns a new instance of Credentials.



7
8
9
10
11
12
13
# File 'lib/canada_post/credentials.rb', line 7

def initialize(options={})
  requires!(options, :username, :password, :customer_number, :mode)
  @username         = options[:username]
  @password         = options[:password]
  @customer_number  = options[:customer_number]
  @mode             = options[:mode] || 'development'
end

Instance Attribute Details

#customer_numberObject (readonly)

Returns the value of attribute customer_number.



5
6
7
# File 'lib/canada_post/credentials.rb', line 5

def customer_number
  @customer_number
end

#modeObject (readonly)

Returns the value of attribute mode.



5
6
7
# File 'lib/canada_post/credentials.rb', line 5

def mode
  @mode
end

#passwordObject (readonly)

Returns the value of attribute password.



5
6
7
# File 'lib/canada_post/credentials.rb', line 5

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



5
6
7
# File 'lib/canada_post/credentials.rb', line 5

def username
  @username
end