Class: Tappay::CardHolder
- Inherits:
-
Object
- Object
- Tappay::CardHolder
- Defined in:
- lib/tappay/card_holder.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
Instance Method Summary collapse
-
#initialize(name:, email:, phone_number:) ⇒ CardHolder
constructor
A new instance of CardHolder.
- #to_h ⇒ Object (also: #as_json)
Constructor Details
#initialize(name:, email:, phone_number:) ⇒ CardHolder
5 6 7 8 9 |
# File 'lib/tappay/card_holder.rb', line 5 def initialize(name:, email:, phone_number:) @name = name @email = email @phone_number = phone_number end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
3 4 5 |
# File 'lib/tappay/card_holder.rb', line 3 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/tappay/card_holder.rb', line 3 def name @name end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
3 4 5 |
# File 'lib/tappay/card_holder.rb', line 3 def phone_number @phone_number end |
Instance Method Details
#to_h ⇒ Object Also known as: as_json
11 12 13 14 15 16 17 |
# File 'lib/tappay/card_holder.rb', line 11 def to_h { name: name, email: email, phone_number: phone_number } end |