Sha256: e6bf72ffb514669e2a621f8d34d43e04f6202ed5303eb0c7795ee0c49cbc9249
Contents?: true
Size: 724 Bytes
Versions: 1
Compression:
Stored size: 724 Bytes
Contents
class Mic class Search def initialize @a = [] CSV.foreach(file) do |row| h = {} h[:mic] = row[2] h[:acronym] = row[6] h[:market_name] = row[5] h[:market_type] = row[4] h[:operating_mic] = row[3] h[:country_code] = row[1] h[:country_name] = row[0] h[:city] = row[7] h[:website] = row[8] @a << h end end def select_by(symbol, string, include_segments) @a = @a.select{ |m| m[:market_type] == 'O' } unless include_segments @a.select{ |m| m[symbol] =~ Regexp.new(string, 'i') } end def file File.expand_path('../../files/ISO10383.csv', File.dirname(__FILE__)) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mic-1.0.2 | lib/mic/search.rb |