Sha256: f46c871bb032129cbe52dc6647b9b685c02ad3551b337ee4503b61c9614f91cc

Contents?: true

Size: 565 Bytes

Versions: 5

Compression:

Stored size: 565 Bytes

Contents

=begin
module CountrySelectEngine
  module ParseHelper
    def get_code row  
      code   = row.search("td[@class='g']").inner_text
      code[-code.size, 2]
    end

    def get_name row
      row.search("td[@class='v']").first.inner_text
    end

    def country_row? row    
      row.search("td[@class='n']") && n_row?(row) && g_row?(row)           
    end

    def n_row? row
      row.search("td[@class='n']").inner_html =~ /^namesterritory$/
    end

    def g_row? row
      row.search("td[@class='g']").inner_html =~ /^[A-Z]{2}/
    end
  end  
end
=end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
country-select-engine-0.2.1 lib/parse_helper.rb
country-select-engine-0.2.0 lib/parse_helper.rb
country-select-engine-0.1.2 lib/parse_helper.rb
country-select-engine-0.1.1 lib/parse_helper.rb
country-select-engine-0.1.0 lib/parse_helper.rb