Class: Respo::Successes::Base

Inherits:
Response
  • Object
show all
Defined in:
lib/respo/successes/base.rb

Direct Known Subclasses

Create, Destroy, Index, Show, Update

Instance Attribute Summary collapse

Attributes inherited from Response

#record, #root, #view

Instance Method Summary collapse

Methods inherited from Response

call, #serializer

Methods included from Helpers

#action_name, #camelize, pluralize, singularize

Constructor Details

#initialize(record, view: nil, root: nil, label: nil) ⇒ Base

Returns a new instance of Base.



8
9
10
# File 'lib/respo/successes/base.rb', line 8

def initialize(record, view: nil, root: nil, label: nil)
  super(record, view: view, root: root, label: label)
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



6
7
8
# File 'lib/respo/successes/base.rb', line 6

def label
  @label
end

Instance Method Details

#callObject



12
13
14
# File 'lib/respo/successes/base.rb', line 12

def call
  { json: data, status: status_code }
end