Guest User

Untitled

a guest
Jan 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. def build_market(type, postal_code, radius=5)
  2. case type
  3. when "Metro"
  4. return Markets::Cbsa.new :name => postal_code.cbsa_name
  5. when "County"
  6. return Markets::County.new :name => postal_code.county, :ansi => postal_code.county_ansi
  7. when "DMA"
  8. return Markets::Dma.new :name => postal_code.dma.name, :external_key => postal_code.dma.external_key, :rank => postal_code.dma.rank
  9. when "Radius"
  10. return Markets::Radius.new :name => postal_code.city, :point_of_origin => postal_code.zip_code, :size => radius.to_i
  11. else
  12. return Markets::Cbsa.new :name => postal_code.cbsa_name, :division_name => postal_code.cbsa_division_name, :cbsa_type => postal_code.cbsa_type
  13. end
  14. end
Add Comment
Please, Sign In to add comment