Class: Xsay::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/xsay.rb

Constant Summary collapse

ANIMALS =
Dir[File.expand_path("xsay/templates/*.template", File.dirname(__FILE__))]

Instance Method Summary collapse

Instance Method Details

#all(message) ⇒ Object



18
19
20
21
22
# File 'lib/xsay.rb', line 18

def all(message)
  ANIMALS.each do |filename|
    render(message, IO.read(filename))
  end
end

#random(message) ⇒ Object



25
26
27
# File 'lib/xsay.rb', line 25

def random(message)
  render(message, IO.read(ANIMALS.shuffle.sample))
end