module Closeio::Client::Opportunity

Public Instance Methods

create_opportunity(options = {}) click to toggle source
# File lib/closeio/resources/opportunity.rb, line 16
def create_opportunity(options = {})
  post(opportunity_path, options)
end
delete_opportunity(id) click to toggle source
# File lib/closeio/resources/opportunity.rb, line 24
def delete_opportunity(id)
  delete(opportunity_path(id))
end
find_opportunity(id) click to toggle source
# File lib/closeio/resources/opportunity.rb, line 12
def find_opportunity(id)
  get(opportunity_path(id))
end
list_opportunities(options = {}, paginate = false) click to toggle source
# File lib/closeio/resources/opportunity.rb, line 4
def list_opportunities(options = {}, paginate = false)
  if paginate
    paginate(opportunity_path, options)
  else
    get(opportunity_path, options)
  end
end
update_opportunity(id, options = {}) click to toggle source
# File lib/closeio/resources/opportunity.rb, line 20
def update_opportunity(id, options = {})
  put(opportunity_path(id), options)
end

Private Instance Methods

opportunity_path(id = nil) click to toggle source
# File lib/closeio/resources/opportunity.rb, line 30
def opportunity_path(id = nil)
  id ? "opportunity/#{id}/" : 'opportunity/'
end