Class: Benchmark::HTTP::Command::Top

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/benchmark/http/command.rb

Instance Method Summary collapse

Instance Method Details

#callObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/benchmark/http/command.rb', line 48

def call
  if verbose?
    Console.logger.debug!
  elsif quiet?
    Console.logger.warn!
  end
  
  if @options[:version]
    puts "#{self.name} v#{VERSION}"
  elsif @options[:help]
    self.print_usage
  else
    @command.call
  end
end

#quiet?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/benchmark/http/command.rb', line 44

def quiet?
  @options[:logging] == :quiet
end

#verbose?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/benchmark/http/command.rb', line 40

def verbose?
  @options[:logging] == :verbose
end