Class: Swagalicious::ExampleHelpers::MockResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/swagalicious/example_helpers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ MockResponse

Returns a new instance of MockResponse.



68
69
70
71
72
# File 'lib/swagalicious/example_helpers.rb', line 68

def initialize(file_name)
  @body    = File.read(File.expand_path("#{File.join(ENV["MOCK_PATH"], file_name)}.json", __FILE__))
  @status  = 200
  @headers = {}
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



66
67
68
# File 'lib/swagalicious/example_helpers.rb', line 66

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



66
67
68
# File 'lib/swagalicious/example_helpers.rb', line 66

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



66
67
68
# File 'lib/swagalicious/example_helpers.rb', line 66

def status
  @status
end