Class: Profile::Rating

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

Instance Method Summary collapse

Constructor Details

#initialize(clientw) ⇒ Rating

Returns a new instance of Rating.



182
183
184
# File 'lib/profile.rb', line 182

def initialize(clientw)
    @clientw = clientw
end

Instance Method Details

#set(options) ⇒ Object



186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/profile.rb', line 186

def set(options)
    payload = {
        "source_id" => options['source_id'],
        "rating" => options["rating"]
    }
    payload = ReqUtils.add_if_not_blank(payload, 'profile_id', options['profile_id'])
    payload = ReqUtils.add_if_not_blank(payload, 'profile_reference', options['profile_reference'])
    payload = ReqUtils.add_if_not_blank(payload, 'filter_id', options['filter_id'])
    payload = ReqUtils.add_if_not_blank(payload, 'filter_reference', options['filter_reference'])
    resp = @clientw.patch("profile/rating", payload)
    return resp['data']
end