Class: Api::ResponseBuilder::Base

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

Overview

Base Class for building api response

Direct Known Subclasses

Data, Messages, Status, StatusCode

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Base.



9
10
11
12
# File 'lib/api/response_builder/base.rb', line 9

def initialize(resource, config = {})
  @resource = resource
  @config = config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



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

def config
  @config
end

#resourceObject

Returns the value of attribute resource.



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

def resource
  @resource
end