class Catobills::FederalBody
Attributes
abbrev[R]
id[R]
name[R]
Public Class Methods
load()
click to toggle source
# File lib/catobills/federal_body.rb, line 12 def self.load url = "http://dwillis.github.io/catobills/federal-bodies.json" response = HTTParty.get(url) bodies = Oj.load(response.body) bodies.map{|b| self.new( id: b['id'], name: b['name'], abbrev: b['abbrev'])} end
new(params={})
click to toggle source
# File lib/catobills/federal_body.rb, line 6 def initialize(params={}) params.each_pair do |k,v| instance_variable_set("@#{k}", v) end end