Class: Clarification::Predict

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(models) ⇒ Predict

Returns a new instance of Predict.


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

def initialize(models)
  @models = models
  @last_response = nil
end

Instance Attribute Details

#last_responseObject (readonly)

Returns the value of attribute last_response


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

def last_response
  @last_response
end

Instance Method Details

#by_url(url) ⇒ Object


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

def by_url(url)
  requester = PredictRequester.new(@models)
  response = requester.get(url)
  @last_response = Enrich.new(response).run
  return @last_response
end