Class: AlphaCard::Account
- Inherits:
-
AlphaCardObject
- Object
- AlphaCardObject
- AlphaCard::Account
- Defined in:
- lib/alpha_card/objects/account.rb
Overview
Implementation of Alpha Card Services account object. Contains credentials (username and password) for the Alpha Card Gateway API access.
Instance Method Summary collapse
-
#filled? ⇒ Boolean
Say if all the credentials of Account is filled.
-
#initialize(username, password) ⇒ Account
constructor
AlphaCard::Account
constructor.
Methods inherited from AlphaCardObject
Constructor Details
#initialize(username, password) ⇒ Account
AlphaCard::Account
constructor.
20 21 22 23 |
# File 'lib/alpha_card/objects/account.rb', line 20 def initialize(username, password) self.username = username self.password = password end |
Instance Method Details
#filled? ⇒ Boolean
Say if all the credentials of Account is filled. Username and password can’t be a nil
object or an empty String
.
43 44 45 46 |
# File 'lib/alpha_card/objects/account.rb', line 43 def filled? attrs = [username, password] !attrs.empty? && attrs.all? { |attr| attr && !attr.strip.empty? } end |