Module: Essential::Resource::Create
- Included in:
- Messaging::Message, Messaging::Subscriber, PaginatorProxy
- Defined in:
- lib/essential/resource/create.rb
Instance Method Summary collapse
Instance Method Details
#create(params, headers: @headers) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/essential/resource/create.rb', line 5 def create(params, headers: @headers) params = (params || {}).clone params = @params.merge(params) if @params params = filter_attrs(params) response = request(:post, url: url, params: params, headers: headers) json = JSON.parse(response) json = @params.merge(json) if @params json = @attrs.merge(json) if @attrs from_attributes(json) end |