class Lpgrid::Grid

Attributes

position[R]

Public Class Methods

grid() click to toggle source
# File lib/lpgrid/grid.rb, line 5
def self.grid
  @grid ||= CSV.table(Lpgrid.config.csv)
end
new(position) click to toggle source
# File lib/lpgrid/grid.rb, line 9
def initialize(position)
  @position = position
end

Public Instance Methods

fetch() click to toggle source
# File lib/lpgrid/grid.rb, line 13
def fetch
  parse_position
  self.class.grid[@row.to_i].field(@col.downcase.to_sym)
end

Private Instance Methods

parse_position() click to toggle source
# File lib/lpgrid/grid.rb, line 20
def parse_position
  @col, @row = position.split(//)
end