Class: Tappay::CardHolder

Inherits:
Object
  • Object
show all
Defined in:
lib/tappay/card_holder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'lib/tappay/card_holder.rb', line 3

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/tappay/card_holder.rb', line 3

def name
  @name
end

#phone_numberObject (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_hObject 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