class RFlare::Node

Attributes

id[R]
match[R]
valid[R]

Public Class Methods

new(id, match, rows, columns, row_bounds, col_bounds) click to toggle source
# File lib/rflare.rb, line 40
def initialize id, match, rows, columns, row_bounds, col_bounds
  @id = id || '_'
  @match = Regexp.new(match || '.*')
  @valid = Square.new(
    Spec.new(rows || '0:*').range(0, row_bounds),
    Spec.new(columns || '0:*').range(0, col_bounds))
end

Public Instance Methods

matches(ss, row, col) click to toggle source
# File lib/rflare.rb, line 50
def matches ss, row, col
  @valid.include? row, col and (ss[row,col] || '').to_s =~ @match
end