166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
# File 'lib/amee/v3/return_value_definition.rb', line 166
def self.create(connection,itemdefuid, options = {})
unless options.is_a?(Hash)
raise AMEE::ArgumentError.new("Second argument must be a hash of options!")
end
vt=options.delete(:valuetype)
case vt
when 'text'
options.merge!( :valueDefinition=>"CCEB59CACE1B")
else
options.merge!( :valueDefinition=>"45433E48B39F")
end
options.merge!(:returnobj=>true)
response = connection.v3_post("/#{AMEE::Connection.api_version}/definitions/#{itemdefuid}/returnvalues", options)
return ReturnValueDefinition.load(connection,itemdefuid , response.['Location'].split('/')[7])
rescue
raise AMEE::BadData.new("Couldn't create ReturnValueDefinition. Check that your information is correct.\n#{response}")
end
|