Class: Bcli::Commands::Drive::Search
- Inherits:
-
Bcli::Command
- Object
- Bcli::Command
- Bcli::Commands::Drive::Search
- Defined in:
- lib/bcli/commands/drive/search.rb
Instance Method Summary collapse
- #execute(input: $stdin, output: $stdout, page: 1) ⇒ Object
-
#initialize(options) ⇒ Search
constructor
attr_reader :query, :download_file.
Methods inherited from Bcli::Command
#ask, #client, #config, #credentials, #download, #link_to, #logger, #open_in_browser, #parse_json, #pastel, #prompt
Constructor Details
#initialize(options) ⇒ Search
attr_reader :query, :download_file
10 11 12 13 14 |
# File 'lib/bcli/commands/drive/search.rb', line 10 def initialize() @options = # @download_file = options[:download] # @query = options[:query] end |
Instance Method Details
#execute(input: $stdin, output: $stdout, page: 1) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/bcli/commands/drive/search.rb', line 16 def execute(input: $stdin, output: $stdout, page: 1) res = client.get("/uploads?q[filename_cont]=#{query}&page=#{page}") if res.success? output.puts handle_search_response(res) else output.puts pastel.red res.inspect end end |