Class: Billing::Report
- Inherits:
-
Object
- Object
- Billing::Report
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/billing/report.rb
Overview
creates and populates the BIF file
Instance Attribute Summary collapse
-
#billing_items ⇒ Object
Returns the value of attribute billing_items.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Instance Method Summary collapse
Instance Attribute Details
#billing_items ⇒ Object
Returns the value of attribute billing_items
6 7 8 |
# File 'app/models/billing/report.rb', line 6 def billing_items @billing_items end |
#end_date ⇒ Object
Returns the value of attribute end_date
6 7 8 |
# File 'app/models/billing/report.rb', line 6 def end_date @end_date end |
#fields ⇒ Object
Returns the value of attribute fields
6 7 8 |
# File 'app/models/billing/report.rb', line 6 def fields @fields end |
#file_name ⇒ Object
Returns the value of attribute file_name
6 7 8 |
# File 'app/models/billing/report.rb', line 6 def file_name @file_name end |
#start_date ⇒ Object
Returns the value of attribute start_date
6 7 8 |
# File 'app/models/billing/report.rb', line 6 def start_date @start_date end |
Instance Method Details
#create ⇒ Object
10 11 12 13 14 |
# File 'app/models/billing/report.rb', line 10 def create f = File.new("#{file_name}.bif", 'w+') f.write(data) f.close end |
#data ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/models/billing/report.rb', line 16 def data ''.tap do |text| billing_items.each do |billing_item| text << billing_item.to_s(fields) end end end |