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.



9
10
11
# File 'lib/giphy/cli.rb', line 9

def initialize(keyword)
  @keyword = keyword
end

Class Method Details

.run(keyword) ⇒ Object



5
6
7
# File 'lib/giphy/cli.rb', line 5

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

Instance Method Details

#searchObject



13
14
15
16
# File 'lib/giphy/cli.rb', line 13

def search
  system "echo 'Showing the GIF on your browser'"
  Launchy.open(url)
end