Method: ZendeskAPI::Collection#build

Defined in:
lib/zendesk_api/collection.rb

#build(opts = {}) ⇒ Object

Convenience method to build a new resource and add it to the collection. Fetches the collection as well.

Parameters:

  • opts (Hash) (defaults to: {})

    Options or attributes to pass



89
90
91
92
93
# File 'lib/zendesk_api/collection.rb', line 89

def build(opts = {})
  wrap_resource(opts, true).tap do |res|
    self << res
  end
end