Class: BaseCRM::LeadUnqualifiedReasonsService

Inherits:
Object
  • Object
show all
Defined in:
lib/basecrm/services/lead_unqualified_reasons_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ LeadUnqualifiedReasonsService

Returns a new instance of LeadUnqualifiedReasonsService.



5
6
7
# File 'lib/basecrm/services/lead_unqualified_reasons_service.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#allEnumerable

Retrieve all lead unqualified reasons

get ‘/lead_unqualified_reasons’

If you want to use filtering or sorting (see #where).

Returns:

  • (Enumerable)

    Paginated resource you can use to iterate over all the resources.



15
16
17
# File 'lib/basecrm/services/lead_unqualified_reasons_service.rb', line 15

def all
  PaginatedResource.new(self)
end

#where(options = {}) ⇒ Array<LeadUnqualifiedReason>

Retrieve all lead unqualified reasons

get ‘/lead_unqualified_reasons’

Returns all lead unqualified reasons available to the user according to the parameters provided

Parameters:

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

    Search options

Returns:

  • (Array<LeadUnqualifiedReason>)

    The list of LeadUnqualifiedReasons for the first page, unless otherwise specified.



27
28
29
30
31
# File 'lib/basecrm/services/lead_unqualified_reasons_service.rb', line 27

def where(options = {})
  _, _, root = @client.get("/lead_unqualified_reasons", options)

  root[:items].map{ |item| LeadUnqualifiedReason.new(item[:data]) }
end