Module: PipeDrive

Defined in:
lib/pipe_drive/base.rb,
lib/pipe_drive/deal.rb,
lib/pipe_drive/stage.rb,
lib/pipe_drive/person.rb,
lib/pipe_drive/pipeline.rb,
lib/pipe_drive/exception.rb,
lib/pipe_drive/deal_field.rb,
lib/pipe_drive/field_base.rb,
lib/pipe_drive/organization.rb,
lib/pipe_drive/person_field.rb,
lib/pipe_drive/send_request.rb,
lib/pipe_drive_ruby_wrapper.rb,
lib/pipe_drive/resource_base.rb,
lib/pipe_drive/organization_field.rb,
lib/pipe_drive/overall_source_base.rb

Defined Under Namespace

Classes: Base, Deal, DealField, FieldBase, MissingApiToken, NotAllowSearchType, NotProvideAssignType, Organization, OrganizationField, OverallSourceBase, Person, PersonField, Pipeline, RequestError, ResourceBase, SendRequest, Stage, TargetNotFound

Constant Summary collapse

API_VERSION =
'v1'
DEFAULT_PER_PAGE =
10
STRICT =
true
RESOURCE_CLASSES =
%w[Organization Person Deal]
FIELD_CLASSES =
%w[OrganizationField PersonField DealField]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_tokenObject

Returns the value of attribute api_token.



13
14
15
# File 'lib/pipe_drive_ruby_wrapper.rb', line 13

def api_token
  @api_token
end

.field_keysObject



22
23
24
25
26
27
28
29
# File 'lib/pipe_drive_ruby_wrapper.rb', line 22

def field_keys
  return @field_keys unless @field_keys.nil? || @field_keys.empty?
  @field_keys = {}
  FIELD_CLASSES.each do |class_name|
    @field_keys.merge!(const_get(class_name).field_keys_map)
  end
  @field_keys
end

.stage_idsObject



39
40
41
42
# File 'lib/pipe_drive_ruby_wrapper.rb', line 39

def stage_ids
  return @stage_ids unless @stage_ids.nil? || @stage_ids.empty?
  @stage_ids = Stage.stage_ids_map
end

Class Method Details

.hash_except(hash, except_keys) ⇒ Object



56
57
58
59
60
# File 'lib/pipe_drive_ruby_wrapper.rb', line 56

def hash_except(hash, except_keys)
  all_keys = hash.keys
  remain_keys = all_keys - except_keys
  hash.slice(*remain_keys)
end

.hostObject



48
49
50
# File 'lib/pipe_drive_ruby_wrapper.rb', line 48

def host
  "https://api.pipedrive.com"
end

.requesterObject



52
53
54
# File 'lib/pipe_drive_ruby_wrapper.rb', line 52

def requester
  SendRequest.new
end

.reset_field_keys!Object



31
32
33
34
35
36
37
# File 'lib/pipe_drive_ruby_wrapper.rb', line 31

def reset_field_keys!
  @field_keys = {}
  FIELD_CLASSES.each do |class_name|
    @field_keys.merge!(const_get(class_name).field_keys_map)
  end
  @field_keys
end

.reset_stage_ids!Object



44
45
46
# File 'lib/pipe_drive_ruby_wrapper.rb', line 44

def reset_stage_ids!
  @stage_ids = Stage.stage_ids_map
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (PipeDrive)

    the object that the method was called on



17
18
19
20
# File 'lib/pipe_drive_ruby_wrapper.rb', line 17

def setup
  yield self
  self
end