Class: Swagalicious::ExampleHelpers::MockResponse
- Inherits:
-
Object
- Object
- Swagalicious::ExampleHelpers::MockResponse
- Defined in:
- lib/swagalicious/example_helpers.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(file_name) ⇒ MockResponse
constructor
A new instance of MockResponse.
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.("#{File.join(ENV["MOCK_PATH"], file_name)}.json", __FILE__)) @status = 200 @headers = {} end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
66 67 68 |
# File 'lib/swagalicious/example_helpers.rb', line 66 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
66 67 68 |
# File 'lib/swagalicious/example_helpers.rb', line 66 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
66 67 68 |
# File 'lib/swagalicious/example_helpers.rb', line 66 def status @status end |