Class: YAPI::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/yapi/fetcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, route_name) ⇒ Fetcher

Returns a new instance of Fetcher.



8
9
10
11
# File 'lib/yapi/fetcher.rb', line 8

def initialize(config, route_name)
  @config = config
  @route_name = route_name
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/yapi/fetcher.rb', line 5

def config
  @config
end

#route_nameObject (readonly)

Returns the value of attribute route_name.



6
7
8
# File 'lib/yapi/fetcher.rb', line 6

def route_name
  @route_name
end

Instance Method Details

#performObject



13
14
15
16
# File 'lib/yapi/fetcher.rb', line 13

def perform
  puts "#{request.method.upcase} #{request.url}"
  puts client.perform(request).to_s(show_headers: config.output_headers?)
end