Class: Klimt::Commands::City
- Inherits:
-
Thor
- Object
- Thor
- Klimt::Commands::City
- Includes:
- Rendering
- Defined in:
- lib/klimt/commands/city.rb
Instance Method Summary collapse
Methods included from Rendering
#jq_installed?, #render, #render_pretty, #render_with_jq
Instance Method Details
#list ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/klimt/commands/city.rb', line 9 def list file = [:featured] ? 'featured-cities.json' : 'cities.json' uri = "http://artsy-geodata.s3-website-us-east-1.amazonaws.com/partner-cities/#{file}" response = Typhoeus.get(uri) jq_filter = [:short] ? '.[] | { full_name, coords }' : '.' = [:short] ? '-c' : '' render response.body, jq_filter: jq_filter, jq_options: end |