Class: Slcsp::SlcspMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/slcsp/slcsp_matcher.rb

Overview

gets input from SlcspParse, finds rate_areas and SLCSP

Instance Method Summary collapse

Constructor Details

#initialize(zip_index, plan_index, slcsp_parser) ⇒ SlcspMatcher

Returns a new instance of SlcspMatcher.



8
9
10
11
12
13
# File 'lib/slcsp/slcsp_matcher.rb', line 8

def initialize(zip_index, plan_index, slcsp_parser)
  @zip_index = zip_index
  @plan_index = plan_index
  @slcsp_parser = slcsp_parser
  @output_medium = Slcsp::Config.output_medium
end

Instance Method Details

#match_eachObject



15
16
17
18
19
20
21
# File 'lib/slcsp/slcsp_matcher.rb', line 15

def match_each
  @output_medium.print(@slcsp_parser.headers_line)
  @slcsp_parser.parse_each do |row|
    second = match(row)
    @output_medium.print("#{row['zipcode']},#{format(second)}\n")
  end
end