Class: PassSummary
- Inherits:
-
Object
- Object
- PassSummary
- Defined in:
- app/models/pass_summary.rb
Instance Attribute Summary collapse
-
#organization ⇒ Object
Returns the value of attribute organization.
-
#passes ⇒ Object
Returns the value of attribute passes.
-
#rows ⇒ Object
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize(organization, passes) ⇒ PassSummary
constructor
A new instance of PassSummary.
- #process_passes ⇒ Object
Constructor Details
#initialize(organization, passes) ⇒ PassSummary
Returns a new instance of PassSummary.
4 5 6 7 8 9 |
# File 'app/models/pass_summary.rb', line 4 def initialize(organization, passes) @organization = organization @passes = passes @rows = {} process_passes end |
Instance Attribute Details
#organization ⇒ Object
Returns the value of attribute organization.
2 3 4 |
# File 'app/models/pass_summary.rb', line 2 def organization @organization end |
#passes ⇒ Object
Returns the value of attribute passes.
2 3 4 |
# File 'app/models/pass_summary.rb', line 2 def passes @passes end |
#rows ⇒ Object
Returns the value of attribute rows.
2 3 4 |
# File 'app/models/pass_summary.rb', line 2 def rows @rows end |
Instance Method Details
#process_passes ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/models/pass_summary.rb', line 11 def process_passes @passes.each do |pass| pass_type_array = @rows.fetch(pass.pass_type, []) pass_type_array << pass @rows[pass.pass_type] = pass_type_array end end |