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

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ResponseMate::Commands::Base

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

rubocop:disable Metrics/AbcSize



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/response_mate/commands/inspect.rb', line 5

def run # rubocop:disable Metrics/AbcSize
  environment = ResponseMate::Environment.new(options[:environment])
  options[:manifest] = ResponseMate::Manifest.new(options[:requests_manifest],
                                                  environment)

  @inspector = ResponseMate::Inspector.new(options)
  @history = []

  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