Module: Vhx::ApiOperations::Create::ClassMethods
- Defined in:
- lib/vhx/utilities/api_operations/create.rb
Instance Method Summary collapse
Instance Method Details
#create(payload) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/vhx/utilities/api_operations/create.rb', line 5 def create(payload) klass = get_klass response = Vhx.connection.post do |req| req.url('/' + klass.downcase + 's') #This url is based purely on VHX's API convention. req.body = payload end self.new(response.body) end |