Class: Pinfirmable::Pin
- Inherits:
-
Object
- Object
- Pinfirmable::Pin
- Defined in:
- lib/pinfirmable/pin.rb
Instance Attribute Summary collapse
-
#digits ⇒ Object
Returns the value of attribute digits.
Instance Method Summary collapse
-
#initialize(digits) ⇒ Pin
constructor
A new instance of Pin.
- #matches_user_pin(user) ⇒ Object
Constructor Details
#initialize(digits) ⇒ Pin
Returns a new instance of Pin.
5 6 7 |
# File 'lib/pinfirmable/pin.rb', line 5 def initialize(digits) @digits = digits.flatten.join end |
Instance Attribute Details
#digits ⇒ Object
Returns the value of attribute digits.
3 4 5 |
# File 'lib/pinfirmable/pin.rb', line 3 def digits @digits end |
Instance Method Details
#matches_user_pin(user) ⇒ Object
9 10 11 |
# File 'lib/pinfirmable/pin.rb', line 9 def matches_user_pin(user) user.pinfirmable_pin == @digits end |