Class: GoFigure::StubHttpFetcher::StringResponse

Inherits:
Object
  • Object
show all
Includes:
Response
Defined in:
lib/go_figure/test/stub_http_fetcher.rb

Instance Method Summary collapse

Methods included from Response

#invoked!, #invoked?

Constructor Details

#initialize(content, code = 200, headers = {}) ⇒ StringResponse

Returns a new instance of StringResponse.



23
24
25
26
27
# File 'lib/go_figure/test/stub_http_fetcher.rb', line 23

def initialize(content, code = 200, headers = {})
  @content = content
  @code = code.to_s
  @headers = headers
end

Instance Method Details

#executeObject



29
30
31
# File 'lib/go_figure/test/stub_http_fetcher.rb', line 29

def execute
  HashStruct.new(:body => @content, :code => @code, :headers => @headers)
end