Class: DPay::Payer
- Inherits:
-
Object
- Object
- DPay::Payer
- Defined in:
- lib/dpay/payment/payer.rb,
sig/dpay/payment/payer.rbs
Constant Summary collapse
- EMAIL =
/\A[^@\s]+@[^@\s]+\.[^@\s]+\z/
Instance Attribute Summary collapse
-
#email ⇒ String?
readonly
Returns the value of attribute email.
-
#first_name ⇒ String?
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ String?
readonly
Returns the value of attribute last_name.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#email ⇒ String? (readonly)
Returns the value of attribute email.
7 8 9 |
# File 'lib/dpay/payment/payer.rb', line 7 def email @email end |
#first_name ⇒ String? (readonly)
Returns the value of attribute first_name.
7 8 9 |
# File 'lib/dpay/payment/payer.rb', line 7 def first_name @first_name end |
#last_name ⇒ String? (readonly)
Returns the value of attribute last_name.
7 8 9 |
# File 'lib/dpay/payment/payer.rb', line 7 def last_name @last_name end |
Class Method Details
Instance Method Details
#with_email(email) ⇒ self
13 14 15 16 17 18 |
# File 'lib/dpay/payment/payer.rb', line 13 def with_email(email) raise InvalidArgumentError, %(Invalid email "#{email}") unless email.is_a?(String) && EMAIL.match?(email) @email = email self end |
#with_name(first_name, last_name) ⇒ self
20 21 22 23 24 |
# File 'lib/dpay/payment/payer.rb', line 20 def with_name(first_name, last_name) @first_name = first_name @last_name = last_name self end |