Class: Profile::Json

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

Instance Method Summary collapse

Constructor Details

#initialize(clientw) ⇒ Json

Returns a new instance of Json.



134
135
136
# File 'lib/profile.rb', line 134

def initialize(clientw)
    @clientw = clientw
end

Instance Method Details

#add(options) ⇒ Object



147
148
149
150
151
152
153
154
155
156
157
# File 'lib/profile.rb', line 147

def add(options)
    payload = {
        "source_id" => options['source_id'],
        "profile_json" => options['profile_json'] 
    }
    payload = ReqUtils.add_if_not_blank(payload, 'profile_reference', options['profile_reference'])
    payload = ReqUtils.add_if_not_blank(payload, 'timestamp_reception', options['timestamp_reception'])
    payload = ReqUtils.add_if_not_blank(payload, 'training_metadata', ReqUtils.(options['training_metadata']))
    resp = @clientw.post('profile/json', payload)
    return resp['data']
end

#check(options) ⇒ Object



138
139
140
141
142
143
144
145
# File 'lib/profile.rb', line 138

def check(options)
    payload = {
        "profile_json" => options['profile_json'] 
    }
    payload = ReqUtils.add_if_not_blank(payload, 'training_metadata', ReqUtils.(options['training_metadata']))
    resp = @clientw.post('profile/json/check', payload)
    return resp['data']
end