Class: PromotionEvaluationService

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

Instance Method Summary collapse

Instance Method Details

#evaluate(id, token, attributes) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/promotion_evaluation_service.rb', line 6

def evaluate(id, token, attributes)
    respone = RestClient::Request.execute(
        :method => :get, 
        params: { id: id }, 
        attributes: attributes, 
        token: token,
        :url => url,
        :timeout => 1,
        :open_timeout => 1,
        content_type: :json
    )
    if response.code == 200
        JSON.parse(response.body)
    else
        raise "No aplica"
    end
end