class Emarsys::Source
Methods for the Source
API
Public Class Methods
collection(account: nil)
click to toggle source
List sources
@return [Hash] List of sources @example
Emarsys::Source.collection
# File lib/emarsys/data_objects/source.rb, line 15 def collection(account: nil) get account, 'source', {} end
create(name:, account: nil)
click to toggle source
Create a new source
@param name [String] Name of the new source @return [Hash] Result data @example
Emarsys::Source.create("My new source")
# File lib/emarsys/data_objects/source.rb, line 25 def create(name:, account: nil) post account, 'source/create', {:name => name} end
destroy(id, account: nil)
click to toggle source
Destroy a specific source
@param id [Integer, String] The internal emarsys id @return [Hash] Result data @example
Emarsys::Source.destroy(2)
# File lib/emarsys/data_objects/source.rb, line 35 def destroy(id, account: nil) delete account, "source/#{id}", {} end