Class: Workarea::PaymentReference
- Inherits:
-
Object
- Object
- Workarea::PaymentReference
- Defined in:
- app/models/workarea/payment_reference.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #email ⇒ Object
- #id ⇒ Object
-
#initialize(user, order = nil) ⇒ PaymentReference
constructor
A new instance of PaymentReference.
Constructor Details
#initialize(user, order = nil) ⇒ PaymentReference
Returns a new instance of PaymentReference.
5 6 7 8 |
# File 'app/models/workarea/payment_reference.rb', line 5 def initialize(user, order = nil) @user = user @order = order end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
3 4 5 |
# File 'app/models/workarea/payment_reference.rb', line 3 def order @order end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
3 4 5 |
# File 'app/models/workarea/payment_reference.rb', line 3 def user @user end |
Instance Method Details
#email ⇒ Object
10 11 12 |
# File 'app/models/workarea/payment_reference.rb', line 10 def email (@user.try(:email) || @order.try(:email)).try(:downcase) end |
#id ⇒ Object
14 15 16 |
# File 'app/models/workarea/payment_reference.rb', line 14 def id @user.try(:id) || @order.try(:user_id).presence || @order.try(:id) end |