Class: Clarification::Enrich

Inherits:
Object
  • Object
show all
Defined in:
lib/clarification/enrich.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_array) ⇒ Enrich

Returns a new instance of Enrich.


6
7
8
9
# File 'lib/clarification/enrich.rb', line 6

def initialize(response_array)
  @response_array = response_array
  @results = {}
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results


4
5
6
# File 'lib/clarification/enrich.rb', line 4

def results
  @results
end

Instance Method Details

#runObject


11
12
13
14
15
16
# File 'lib/clarification/enrich.rb', line 11

def run
  @response_array.each do |model, raw_response |
    @results[model.name] = Objectifier.new(raw_response.body)
  end
  return @results
end