Class: Profile::Json
- Inherits:
-
Object
- Object
- Profile::Json
- Defined in:
- lib/profile.rb
Instance Method Summary collapse
- #add(options) ⇒ Object
- #check(options) ⇒ Object
-
#initialize(clientw) ⇒ Json
constructor
A new instance of Json.
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() payload = { "source_id" => ['source_id'], "profile_json" => ['profile_json'] } payload = ReqUtils.add_if_not_blank(payload, 'profile_reference', ['profile_reference']) payload = ReqUtils.add_if_not_blank(payload, 'timestamp_reception', ['timestamp_reception']) payload = ReqUtils.add_if_not_blank(payload, 'training_metadata', ReqUtils.validateTrainingMetadata(['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() payload = { "profile_json" => ['profile_json'] } payload = ReqUtils.add_if_not_blank(payload, 'training_metadata', ReqUtils.validateTrainingMetadata(['training_metadata'])) resp = @clientw.post('profile/json/check', payload) return resp['data'] end |