Class: ResponseMate::Commands::Inspect

Inherits:
Base
  • Object
show all
Defined in:
lib/response_mate/commands/inspect.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Constructor Details

#initialize(args, options) ⇒ Inspect

Returns a new instance of Inspect


5
6
7
8
9
10
11
# File 'lib/response_mate/commands/inspect.rb', line 5

def initialize(args, options)
  super(args, options)

  @options[:manifest] = ResponseMate::Manifest.new(options[:requests_manifest])
  @inspector = ResponseMate::Inspector.new(@options)
  @history = []
end

Instance Attribute Details

#historyObject

Returns the value of attribute history


3
4
5
# File 'lib/response_mate/commands/inspect.rb', line 3

def history
  @history
end

#inspectorObject (readonly)

Returns the value of attribute inspector


2
3
4
# File 'lib/response_mate/commands/inspect.rb', line 2

def inspector
  @inspector
end

Instance Method Details

#runObject


13
14
15
16
17
18
19
20
21
# File 'lib/response_mate/commands/inspect.rb', line 13

def run
  if args.empty?
    return $stderr.puts 'At least one key has to be specified'.red
  end

  args.each do |key|
    inspector.inspect_key(key)
  end
end