Class: WorksReportFilter
- Inherits:
-
ReportFilter
- Object
- ReportFilter
- WorksReportFilter
- Defined in:
- app/models/works_report_filter.rb
Instance Attribute Summary collapse
-
#invoice ⇒ Object
readonly
Returns the value of attribute invoice.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
-
#work_account_id ⇒ Object
readonly
Returns the value of attribute work_account_id.
Attributes inherited from ReportFilter
#end_on, #page_size, #start_on, #title
Instance Method Summary collapse
-
#initialize(attributes) ⇒ WorksReportFilter
constructor
A new instance of WorksReportFilter.
Constructor Details
#initialize(attributes) ⇒ WorksReportFilter
Returns a new instance of WorksReportFilter.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/works_report_filter.rb', line 6 def initialize(attributes) @work_account_id = nil @invoice = nil @user_id = nil if attributes attributes = attributes.clone work_account_id_param = attributes.delete(:work_account_id) @work_account_id = work_account_id_param.to_i if work_account_id_param && work_account_id_param.size > 0 invoice_param = attributes.delete(:invoice) @invoice = invoice_param == 'true' if invoice_param && invoice_param.size > 0 user_id_param = attributes.delete(:user_id) @user_id = user_id_param.to_i if user_id_param && user_id_param.size > 0 end super(attributes) end |
Instance Attribute Details
#invoice ⇒ Object (readonly)
Returns the value of attribute invoice.
3 4 5 |
# File 'app/models/works_report_filter.rb', line 3 def invoice @invoice end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
4 5 6 |
# File 'app/models/works_report_filter.rb', line 4 def user_id @user_id end |
#work_account_id ⇒ Object (readonly)
Returns the value of attribute work_account_id.
2 3 4 |
# File 'app/models/works_report_filter.rb', line 2 def work_account_id @work_account_id end |