Class: Deas::RequestData

Inherits:
Object
  • Object
show all
Defined in:
lib/deas/request_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ RequestData

Returns a new instance of RequestData.



13
14
15
16
17
18
# File 'lib/deas/request_data.rb', line 13

def initialize(args)
  @request    = args[:request]
  @response   = args[:response]
  @params     = args[:params]
  @route_path = args[:route_path]
end

Instance Attribute Details

#paramsObject (readonly)

The rack app uses this to “compile” the request-related data. The goal here is to wrap up these (and any future) request objects into a struct object to make them available to the runner/handler. This is also to decouple the rack app from the handlers (we can use any rack app as long as they provide this data).



11
12
13
# File 'lib/deas/request_data.rb', line 11

def params
  @params
end

#requestObject (readonly)

The rack app uses this to “compile” the request-related data. The goal here is to wrap up these (and any future) request objects into a struct object to make them available to the runner/handler. This is also to decouple the rack app from the handlers (we can use any rack app as long as they provide this data).



11
12
13
# File 'lib/deas/request_data.rb', line 11

def request
  @request
end

#responseObject (readonly)

The rack app uses this to “compile” the request-related data. The goal here is to wrap up these (and any future) request objects into a struct object to make them available to the runner/handler. This is also to decouple the rack app from the handlers (we can use any rack app as long as they provide this data).



11
12
13
# File 'lib/deas/request_data.rb', line 11

def response
  @response
end

#route_pathObject (readonly)

The rack app uses this to “compile” the request-related data. The goal here is to wrap up these (and any future) request objects into a struct object to make them available to the runner/handler. This is also to decouple the rack app from the handlers (we can use any rack app as long as they provide this data).



11
12
13
# File 'lib/deas/request_data.rb', line 11

def route_path
  @route_path
end

Instance Method Details

#==(other_request_data) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/deas/request_data.rb', line 20

def ==(other_request_data)
  if other_request_data.kind_of?(RequestData)
    self.request    == other_request_data.request    &&
    self.response   == other_request_data.response   &&
    self.params     == other_request_data.params     &&
    self.route_path == other_request_data.route_path
  else
    super
  end
end