Class: One::EmailDirect::Credentials
- Inherits:
-
Object
- Object
- One::EmailDirect::Credentials
- Defined in:
- lib/one/email_direct/credentials.rb
Overview
Class to hold EmailDirect API credentials.
Instance Attribute Summary collapse
-
#account ⇒ String
readonly
EmailDirect account username.
-
#encrypted_password ⇒ String
readonly
optional encryped password (future use).
-
#password ⇒ String
readonly
the API password configured in the EmailDirect web interface.
Class Method Summary collapse
-
.create_from(config) ⇒ One::EmailDirect::Credentials
Create credentials from a hash.
Instance Method Summary collapse
-
#initialize(account, password, encrypted_password = '') ⇒ Credentials
constructor
Constructs a Credentials instance.
Constructor Details
#initialize(account, password, encrypted_password = '') ⇒ Credentials
Constructs a Credentials instance.
19 20 21 22 23 24 25 |
# File 'lib/one/email_direct/credentials.rb', line 19 def initialize(account, password, encrypted_password='') encrypted_password ||= '' @account = account @password = password @encrypted_password = encrypted_password end |
Instance Attribute Details
#account ⇒ String (readonly)
EmailDirect account username.
9 10 11 |
# File 'lib/one/email_direct/credentials.rb', line 9 def account @account end |
#encrypted_password ⇒ String (readonly)
optional encryped password (future use).
9 10 11 |
# File 'lib/one/email_direct/credentials.rb', line 9 def encrypted_password @encrypted_password end |
#password ⇒ String (readonly)
the API password configured in the EmailDirect web interface.
9 10 11 |
# File 'lib/one/email_direct/credentials.rb', line 9 def password @password end |
Class Method Details
.create_from(config) ⇒ One::EmailDirect::Credentials
Create credentials from a hash.
35 36 37 38 39 40 |
# File 'lib/one/email_direct/credentials.rb', line 35 def self.create_from(config) return One::EmailDirect::Credentials.new( config[:account], config[:password], config[:encrypted_password]) end |