Class: DailyDonationReport::Row
- Inherits:
-
Object
- Object
- DailyDonationReport::Row
- Defined in:
- app/models/daily_donation_report.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#order ⇒ Object
Returns the value of attribute order.
-
#person ⇒ Object
Returns the value of attribute person.
-
#person_id ⇒ Object
Returns the value of attribute person_id.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(order) ⇒ Row
constructor
A new instance of Row.
- #to_a ⇒ Object
Constructor Details
#initialize(order) ⇒ Row
Returns a new instance of Row.
36 37 38 39 40 41 42 |
# File 'app/models/daily_donation_report.rb', line 36 def initialize(order) @id = order.id @order = order @total = DailyDonationReport.number_to_currency(order.donations.sum(&:total_price) / 100.0) @person = order.person @person_id = order.person.id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
35 36 37 |
# File 'app/models/daily_donation_report.rb', line 35 def id @id end |
#order ⇒ Object
Returns the value of attribute order.
35 36 37 |
# File 'app/models/daily_donation_report.rb', line 35 def order @order end |
#person ⇒ Object
Returns the value of attribute person.
35 36 37 |
# File 'app/models/daily_donation_report.rb', line 35 def person @person end |
#person_id ⇒ Object
Returns the value of attribute person_id.
35 36 37 |
# File 'app/models/daily_donation_report.rb', line 35 def person_id @person_id end |
#total ⇒ Object
Returns the value of attribute total.
35 36 37 |
# File 'app/models/daily_donation_report.rb', line 35 def total @total end |
Instance Method Details
#to_a ⇒ Object
44 45 46 |
# File 'app/models/daily_donation_report.rb', line 44 def to_a [id, total, person] end |