Class: Presenters::GroupLinePresenter
- Inherits:
-
Object
- Object
- Presenters::GroupLinePresenter
show all
- Includes:
- PipelinesHelper
- Defined in:
- app/models/presenters/grouped_pipeline_inbox_presenter.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#fluidigm_target?, #target_purpose_for
Constructor Details
#initialize(group, request, index, pipeline, inbox) ⇒ GroupLinePresenter
Returns a new instance of GroupLinePresenter.
114
115
116
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 114
def initialize(group, request, index, pipeline, inbox)
@group, @request, @index, @pipeline, @inbox = group, request, index, pipeline, inbox
end
|
Instance Attribute Details
#group ⇒ Object
Returns the value of attribute group.
110
111
112
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 110
def group
@group
end
|
#inbox ⇒ Object
Returns the value of attribute inbox.
110
111
112
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 110
def inbox
@inbox
end
|
#index ⇒ Object
Returns the value of attribute index.
110
111
112
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 110
def index
@index
end
|
#pipeline ⇒ Object
Returns the value of attribute pipeline.
110
111
112
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 110
def pipeline
@pipeline
end
|
#request ⇒ Object
Returns the value of attribute request.
110
111
112
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 110
def request
@request
end
|
Instance Method Details
#barcode ⇒ Object
142
143
144
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 142
def barcode
parent.human_barcode
end
|
#each_field ⇒ Object
134
135
136
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 134
def each_field
inbox.each_method { |method| yield send(method) }
end
|
#group_id ⇒ Object
118
119
120
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 118
def group_id
group.join(', ')
end
|
#groupless? ⇒ Boolean
168
169
170
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 168
def groupless?
yield if group.blank?
end
|
#internal_id ⇒ Object
138
139
140
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 138
def internal_id
parent.id
end
|
#parent ⇒ Object
126
127
128
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 126
def parent
@parent ||= request.asset.labware || Labware.find(group.first)
end
|
#parentless? ⇒ Boolean
176
177
178
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 176
def parentless?
yield if parent.nil?
end
|
#pick_to ⇒ Object
150
151
152
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 150
def pick_to
target_purpose_for(request)
end
|
#plate_purpose ⇒ Object
146
147
148
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 146
def plate_purpose
parent.purpose&.name
end
|
#request_group_id ⇒ Object
122
123
124
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 122
def request_group_id
"request_group_#{group_id.gsub(/[^a-z0-9]+/, '_')}"
end
|
#standard_fields? ⇒ Boolean
172
173
174
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 172
def standard_fields?
yield unless parent.nil?
end
|
#still_required ⇒ Object
162
163
164
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 162
def still_required
wells / parent.height
end
|
#stock_barcode ⇒ Object
158
159
160
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 158
def stock_barcode
parent.source_plate.try(:human_barcode) || 'Unknown'
end
|
#study ⇒ Object
154
155
156
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 154
def study
submission.study_names if submission_id.present?
end
|
#submission_name ⇒ Object
130
131
132
|
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 130
def submission_name
submission.name if submission_id.present?
end
|