Class: Chinacity::Cli
- Inherits:
-
Object
- Object
- Chinacity::Cli
- Defined in:
- lib/chinacity/cli.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Cli
constructor
A new instance of Cli.
- #start ⇒ Object
Constructor Details
#initialize(options) ⇒ Cli
Returns a new instance of Cli.
14 15 16 17 18 19 |
# File 'lib/chinacity/cli.rb', line 14 def initialize @short = [:short] @foramt = [:format] @minimize = [:minimize] @headless = [:headless] end |
Instance Method Details
#start ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/chinacity/cli.rb', line 21 def start doc = Nokogiri::HTML(get_data) get_cities(doc) add_short_name if @short @foramt == :json ? output_json : output_csv end |