Class: Bonita::Utils::SearchHandler

Inherits:
Object
  • Object
show all
Includes:
MappingResolver
Defined in:
lib/bonita/utils.rb

Instance Method Summary collapse

Constructor Details

#initialize(response, payload, resource) ⇒ SearchHandler

Returns a new instance of SearchHandler.



71
72
73
74
75
# File 'lib/bonita/utils.rb', line 71

def initialize(response, payload, resource)
  @response = response
  @payload = payload
  @resource = resource
end

Instance Method Details

#callObject



77
78
79
80
81
82
83
84
# File 'lib/bonita/utils.rb', line 77

def call
  extract.map do |obj|
    @payload[:d].each do |deploy|
      obj.send("#{deploy}=", child_mapper(deploy).extract_single(obj.send(deploy).to_json, :read))
    end
    obj
  end
end