Class: Faker::Bot::Base

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

Constant Summary collapse

Error =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#list(filter = nil) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/faker/bot.rb', line 27

def list(filter = nil)
  if options[:help]
    invoke :help, ['list']
  else
    filter_options = options.merge(filter: filter)
    Faker::Bot::Commands::List.new(filter_options).execute
  end
end

#search(query) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/faker/bot.rb', line 43

def search(query)
  if options[:help]
    invoke :help, ['search']
  else
    Faker::Bot::Commands::Search.new(options).execute(query)
  end
end

#versionObject



15
16
17
# File 'lib/faker/bot.rb', line 15

def version
  puts "v#{Faker::Bot::VERSION}"
end