Class: TagLayout::Walker

Inherits:
Object
  • Object
show all
Defined in:
app/models/tag_layout/walker.rb

Overview

A walker passes over the wells of a plate and yeilds the appropriate tag index

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag_layout) ⇒ Walker

Returns a new instance of Walker


12
13
14
# File 'app/models/tag_layout/walker.rb', line 12

def initialize(tag_layout)
  @tag_layout = tag_layout
end

Instance Attribute Details

#tag_layoutObject (readonly)

Returns the value of attribute tag_layout


6
7
8
# File 'app/models/tag_layout/walker.rb', line 6

def tag_layout
  @tag_layout
end

Instance Method Details

#apply_tags(well, tag, tag2) ⇒ Object

Over-ridden in the as group by plate module to allow the application of multiple tags.


23
24
25
# File 'app/models/tag_layout/walker.rb', line 23

def apply_tags(well, tag, tag2)
  well.attach_tags(tag, tag2) unless well.aliquots.empty?
end

#walk_wellsObject

We don't actually implement the main behaviour here. If you add a new walker, this is where you add your new behaviour

Raises:

  • (StandardError)

18
19
20
# File 'app/models/tag_layout/walker.rb', line 18

def walk_wells
  raise StandardError, "#{self.class.name} should implement #walk_wells"
end