module ContactCongressParser
Constants
- VERSION
Public Class Methods
parse_all_to_constant(path_to_dir)
click to toggle source
# File lib/contact_congress_parser.rb, line 22 def self.parse_all_to_constant(path_to_dir) "Forms = Hash.new\n" + Dir.glob("#{path_to_dir}/*.yaml").map do |file| yaml_str = File.read(file) bioguide = self.parse_bioguide(yaml_str) form = self.parse_form(yaml_str) "Forms[\"#{bioguide}\"] = #{form}" end.join("\n") end
parse_bioguide(yaml_str)
click to toggle source
# File lib/contact_congress_parser.rb, line 18 def self.parse_bioguide(yaml_str) Parser.new(yaml_str).bioguide end
parse_form(yaml_str)
click to toggle source
# File lib/contact_congress_parser.rb, line 14 def self.parse_form(yaml_str) Parser.new(yaml_str).form end