Class: Api::ResponseBuilder::StatusCode

Inherits:
Base
  • Object
show all
Defined in:
lib/api/response_builder/status_code.rb

Overview

Class which helps in building status code of api response

Instance Attribute Summary collapse

Attributes inherited from Base

#config

Instance Method Summary collapse

Constructor Details

#initialize(resource, config = {}) ⇒ StatusCode

Returns a new instance of StatusCode.



9
10
11
12
13
14
# File 'lib/api/response_builder/status_code.rb', line 9

def initialize(resource, config = {})
  super(resource, config)
  @resource = resource
  @status_code = :ok
  set_status_code
end

Instance Attribute Details

#resourceObject

Returns the value of attribute resource.



6
7
8
# File 'lib/api/response_builder/status_code.rb', line 6

def resource
  @resource
end

#status_codeObject

Returns the value of attribute status_code.



6
7
8
# File 'lib/api/response_builder/status_code.rb', line 6

def status_code
  @status_code
end