Class: Logux::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/logux/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, action:, meta:, custom_data: nil) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
12
# File 'lib/logux/response.rb', line 7

def initialize(status, action:, meta:, custom_data: nil)
  @status = status
  @action = action
  @meta = meta
  @custom_data = custom_data
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



5
6
7
# File 'lib/logux/response.rb', line 5

def action
  @action
end

#custom_dataObject (readonly)

Returns the value of attribute custom_data.



5
6
7
# File 'lib/logux/response.rb', line 5

def custom_data
  @custom_data
end

#metaObject (readonly)

Returns the value of attribute meta.



5
6
7
# File 'lib/logux/response.rb', line 5

def meta
  @meta
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/logux/response.rb', line 5

def status
  @status
end

Instance Method Details

#formatObject



14
15
16
# File 'lib/logux/response.rb', line 14

def format
  [status, custom_data || meta.id]
end