Class: PlateWalking::Walker::Location
- Inherits:
-
Object
- Object
- PlateWalking::Walker::Location
- Defined in:
- app/models/plate_walking.rb
Overview
rubocop:todo Style/Documentation
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#initialize(alphanumeric_location) ⇒ Location
constructor
A new instance of Location.
- #to_s ⇒ Object
Constructor Details
#initialize(alphanumeric_location) ⇒ Location
Returns a new instance of Location.
10 11 12 13 14 15 |
# File 'app/models/plate_walking.rb', line 10 def initialize(alphanumeric_location) (match = /^([A-Z])(\d+)$/.match(alphanumeric_location)) || raise(StandardError, "Invalid well location #{alphanumeric_location.inspect}") @row = match[1] @column = match[2].to_i end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
17 18 19 |
# File 'app/models/plate_walking.rb', line 17 def column @column end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
17 18 19 |
# File 'app/models/plate_walking.rb', line 17 def row @row end |
Instance Method Details
#eql?(other) ⇒ Boolean
21 22 23 |
# File 'app/models/plate_walking.rb', line 21 def eql?(other) to_s.eql?(other.to_s) end |
#to_s ⇒ Object
25 26 27 |
# File 'app/models/plate_walking.rb', line 25 def to_s "#{row}#{column}" end |