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.
-
#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.
34 35 36 37 38 39 |
# File 'app/models/daily_donation_report.rb', line 34 def initialize(order) @id = order.id @total = DailyDonationReport.number_to_currency(order.donations.sum(&:total_price).to_f/100) @person = order.person @person_id = order.person.id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
33 34 35 |
# File 'app/models/daily_donation_report.rb', line 33 def id @id end |
#person ⇒ Object
Returns the value of attribute person.
33 34 35 |
# File 'app/models/daily_donation_report.rb', line 33 def person @person end |
#person_id ⇒ Object
Returns the value of attribute person_id.
33 34 35 |
# File 'app/models/daily_donation_report.rb', line 33 def person_id @person_id end |
#total ⇒ Object
Returns the value of attribute total.
33 34 35 |
# File 'app/models/daily_donation_report.rb', line 33 def total @total end |
Instance Method Details
#to_a ⇒ Object
41 42 43 |
# File 'app/models/daily_donation_report.rb', line 41 def to_a [id, total, person] end |