Class: BitClust::Subcommands::QueryCommand

Inherits:
BitClust::Subcommand show all
Defined in:
lib/bitclust/subcommands/query_command.rb

Instance Method Summary collapse

Methods inherited from BitClust::Subcommand

#error, #help, #option_error, #parse, #srcdir_root

Constructor Details

#initializeQueryCommand

Returns a new instance of QueryCommand.


15
16
17
18
# File 'lib/bitclust/subcommands/query_command.rb', line 15

def initialize
  super
  @parser.banner = "Usage: #{File.basename($0, '.*')} query <ruby-script>"
end

Instance Method Details

#exec(argv, options) ⇒ Object


20
21
22
23
24
25
# File 'lib/bitclust/subcommands/query_command.rb', line 20

def exec(argv, options)
  argv.each do |query|
    # pp eval(query)   # FIXME: causes ArgumentError
    p eval(query)
  end
end