Class: Renalware::Pathology::Requests::Cell
- Inherits:
-
Object
- Object
- Renalware::Pathology::Requests::Cell
- Defined in:
- app/models/renalware/pathology/requests/global_rule_sets_table.rb
Instance Attribute Summary collapse
-
#clinic ⇒ Object
readonly
Returns the value of attribute clinic.
-
#request_description ⇒ Object
readonly
Returns the value of attribute request_description.
Instance Method Summary collapse
- #grouped_rule_sets ⇒ Object
-
#initialize(request_description, clinic, rule_sets) ⇒ Cell
constructor
A new instance of Cell.
- #rule_sets ⇒ Object
Constructor Details
#initialize(request_description, clinic, rule_sets) ⇒ Cell
Returns a new instance of Cell.
41 42 43 44 45 |
# File 'app/models/renalware/pathology/requests/global_rule_sets_table.rb', line 41 def initialize(request_description, clinic, rule_sets) @request_description = request_description @clinic = clinic @rule_sets = rule_sets end |
Instance Attribute Details
#clinic ⇒ Object (readonly)
Returns the value of attribute clinic.
39 40 41 |
# File 'app/models/renalware/pathology/requests/global_rule_sets_table.rb', line 39 def clinic @clinic end |
#request_description ⇒ Object (readonly)
Returns the value of attribute request_description.
39 40 41 |
# File 'app/models/renalware/pathology/requests/global_rule_sets_table.rb', line 39 def request_description @request_description end |
Instance Method Details
#grouped_rule_sets ⇒ Object
51 52 53 54 55 |
# File 'app/models/renalware/pathology/requests/global_rule_sets_table.rb', line 51 def grouped_rule_sets @grouped_rule_sets ||= @rule_sets.group_by do |rule_set| [rule_set.request_description_id, rule_set.clinic_id] end end |
#rule_sets ⇒ Object
47 48 49 |
# File 'app/models/renalware/pathology/requests/global_rule_sets_table.rb', line 47 def rule_sets grouped_rule_sets.fetch([request_description.id, clinic.id], []) end |