Class: Giphy::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/giphy/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keyword) ⇒ CLI

Returns a new instance of CLI.



7
8
9
# File 'lib/giphy/cli.rb', line 7

def initialize(keyword)
  @keyword = keyword
end

Class Method Details

.run(keyword) ⇒ Object



3
4
5
# File 'lib/giphy/cli.rb', line 3

def self.run(keyword)
  new(keyword).search
end

Instance Method Details

#searchObject



11
12
13
# File 'lib/giphy/cli.rb', line 11

def search
  system "echo 'Showing the GIF on your default browser: #{url}' && open #{url}"
end