Class: Serfx::Response

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

Overview

Store agent rpc response data All RPC responses in Serf composed of an header and an optional body.

Defined Under Namespace

Classes: Header

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header, body = nil) ⇒ Response

Constructs a response object from a given header and body.

Parameters:

  • header (Hash)

    header of the response as hash

  • body (Hash) (defaults to: nil)

    body of the response as hash



24
25
26
27
# File 'lib/serfx/response.rb', line 24

def initialize(header, body = nil)
  @header = Header.new(header['Seq'], header['Error'])
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



18
19
20
# File 'lib/serfx/response.rb', line 18

def body
  @body
end

#headerObject (readonly)

Returns the value of attribute header.



18
19
20
# File 'lib/serfx/response.rb', line 18

def header
  @header
end