Class: Presenters::GroupLinePresenter

Inherits:
Object
  • Object
show all
Includes:
PipelinesHelper
Defined in:
app/models/presenters/grouped_pipeline_inbox_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PipelinesHelper

#fluidigm_target?, #target_purpose_for

Constructor Details

#initialize(group, request, index, pipeline, inbox) ⇒ GroupLinePresenter


116
117
118
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 116

def initialize(group, request, index, pipeline, inbox)
  @group, @request, @index, @pipeline, @inbox = group, request, index, pipeline, inbox
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group


112
113
114
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 112

def group
  @group
end

#inboxObject (readonly)

Returns the value of attribute inbox


112
113
114
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 112

def inbox
  @inbox
end

#indexObject (readonly)

Returns the value of attribute index


112
113
114
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 112

def index
  @index
end

#pipelineObject (readonly)

Returns the value of attribute pipeline


112
113
114
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 112

def pipeline
  @pipeline
end

#requestObject (readonly)

Returns the value of attribute request


112
113
114
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 112

def request
  @request
end

Instance Method Details

#barcodeObject


146
147
148
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 146

def barcode
  parent.human_barcode
end

#each_fieldObject


136
137
138
139
140
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 136

def each_field
  inbox.each_method do |method|
    yield send(method)
  end
end

#group_idObject


120
121
122
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 120

def group_id
  group.join(', ')
end

#groupless?Boolean

Gates


172
173
174
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 172

def groupless?
  yield if group.blank?
end

#internal_idObject


142
143
144
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 142

def internal_id
  parent.id
end

#parentObject


128
129
130
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 128

def parent
  @parent ||= Labware.find(group.first)
end

#parentless?Boolean


180
181
182
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 180

def parentless?
  yield if parent.nil?
end

#pick_toObject


154
155
156
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 154

def pick_to
  target_purpose_for(request)
end

#plate_purposeObject


150
151
152
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 150

def plate_purpose
  parent.purpose&.name
end

#request_group_idObject


124
125
126
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 124

def request_group_id
  "request_group_#{group_id.gsub(/[^a-z0-9]+/, '_')}"
end

#standard_fields?Boolean


176
177
178
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 176

def standard_fields?
  yield unless parent.nil?
end

#still_requiredObject


166
167
168
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 166

def still_required
  wells / parent.height
end

#stock_barcodeObject


162
163
164
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 162

def stock_barcode
  parent.source_plate.try(:human_barcode) || 'Unknown'
end

#studyObject


158
159
160
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 158

def study
  submission.study_names if submission_id.present?
end

#submission_nameObject


132
133
134
# File 'app/models/presenters/grouped_pipeline_inbox_presenter.rb', line 132

def submission_name
  submission.name if submission_id.present?
end