lib/pardot/objects/prospect_accounts.rb in ruby-pardot-1.3.2 vs lib/pardot/objects/prospect_accounts.rb in ruby-pardot-1.4.0

- old
+ new

@@ -4,11 +4,10 @@ def prospect_accounts @prospect_accounts ||= ProspectAccounts.new self end class ProspectAccounts - def initialize(client) @client = client end def query(search_criteria) @@ -16,37 +15,37 @@ result['total_results'] = result['total_results'].to_i if result['total_results'] result end - def describe(params={}) + def describe(params = {}) post('/do/describe', params) end - def create(params={}) + def create(params = {}) post('/do/create', params) end # read_by_id # update_by_id - [:read, :update].each do |verb| - define_method(verb) do |id, params={}| + %i[read update].each do |verb| + define_method(verb) do |id, params = {}| post(api_url(verb, 'id', id), params) end end private def api_url(verb, direct_to, value) "/do/#{verb}/#{direct_to}/#{value}" end - def get(path, params={}, result='prospectAccount') + def get(path, params = {}, result = 'prospectAccount') response = @client.get('prospectAccount', path, params) result ? response[result] : response end - def post(path, params={}, result='prospectAccount') + def post(path, params = {}, result = 'prospectAccount') response = @client.post('prospectAccount', path, params) result ? response[result] : response end end end