rdgem 0.2.5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25291b355f23ab7f3bcef9f07d830ef4794cbe3a
4
- data.tar.gz: 366f57d5d875d91457976a612399ca782ad7b3ff
3
+ metadata.gz: bbf8b78fd7f5c05410be1ad48fb4cf66cbf5bf9f
4
+ data.tar.gz: 40deb2937a8b1253166d3a81aa7d97279aecb6bc
5
5
  SHA512:
6
- metadata.gz: 705a64b12ae1d085bda4168285c5b9a681677428d1a0f118de7332bd55ac52ee18387fad0d518198d3c7aa80648e34dae92c7ea146baa2fdf24814c092d4aeb2
7
- data.tar.gz: a6b22506690f6374599aee4e16d7c63ffa1ca621b09fb756feafc6d2e6d148325b99018359e15d112e74de2118ce80aa3e41d96450a74d9380a826ceceb48ce3
6
+ metadata.gz: f6bc0fd8b158cd9d7641eb6fd0c9ac480a8f280209a914387bbd929905e04012ab52221adc48a86a548bbdc1305084e9fbd72db6ec71d3b17acda9417c858a05
7
+ data.tar.gz: ff065b04901315a08eca3cc47df8c6fe5678bcfbd150f18686376c6f47d88fd512923d44215833c925b9df548cc92a92d5de381877913047407f1ad66d796146
data/lib/rdgem.rb CHANGED
@@ -15,141 +15,4 @@ module Rdgem
15
15
  'Content-Type'=>'application/x-www-form-urlencoded',
16
16
  'User-Agent'=>'Ruby.Pipedrive.Api' }
17
17
 
18
- #pushes the lead to pipedrive
19
- #def self.send_lead(app_key, lead_to_person)
20
- # query = PIPEDRIVE_API + 'persons?' + TOKEN + app_key
21
- #
22
- # # response = HTTParty.post(query,
23
- # # :body => lead_to_person,
24
- # # :headers => HEADERS)
25
- #end
26
-
27
- #queries for a company name. creates when it doesn't exist.
28
- # def self.get_or_create_company(app_key, company)
29
- # org_app_id = ""
30
- #
31
- # query = PIPEDRIVE_API + 'organizations/find?term=' \
32
- # + company + '&start=0&' + TOKEN + app_key
33
- #
34
- # response = HTTParty.get(query)
35
- # #if successfull and with content, get the company app_key
36
- # #so as not to create another with the same name
37
- # if response["success"]
38
- # unless response["data"] == nil
39
- # response["data"].each do |search|
40
- # if search['name'] == company
41
- # org_app_id = search['id']
42
- # #not caring about duplicates.
43
- # #we will ensure we at least won't create any
44
- # break
45
- # end
46
- # end
47
- # else
48
- # #didn't find, create one
49
- # input_query = PIPEDRIVE_API + 'organizations?' + TOKEN + app_key
50
- #
51
- # org_response = HTTParty.post(input_query,
52
- # :body => {:name =>company},
53
- # :headers => HEADERS )
54
- #
55
- # unless org_response["data"] == nil
56
- # org_app_id = org_response["data"]["id"]
57
- # end
58
- # end
59
- # else
60
- # #error getting company
61
- # end
62
- # return org_app_id
63
- # end
64
-
65
- # adds a new field to the owner app_key's account
66
- # def self.add_field_to_user(app_key, field_name)
67
- # field_api_key = false
68
- #
69
- # input_query = PIPEDRIVE_API + 'personFields?' + TOKEN + app_key
70
- #
71
- # response = HTTParty.post(input_query,
72
- # :body => {:name =>"#{field_name}",
73
- # :field_type => "varchar"},
74
- # :headers => HEADERS )
75
- #
76
- # unless response["data"] == nil
77
- # field_api_id = response["data"]["id"]
78
- #
79
- # key_query = PIPEDRIVE_API + 'personFields/'\
80
- # + field_api_id.to_s + "?" + TOKEN + app_key
81
- #
82
- #
83
- # field_key_response = HTTParty.get(key_query)
84
- #
85
- # unless field_key_response["data"] == nil
86
- # field_api_key = field_key_response["data"]["key"]
87
- # end
88
- # end
89
- # return field_api_key
90
- # end
91
-
92
- #checks if the key is valid and if the custom fields are created in the acc
93
- # if any field is missing, create it
94
- # def self.assert_fields(fields, app_key)
95
- # @field_key = []
96
- #
97
- # query = PIPEDRIVE_API + 'personFields?' + TOKEN + app_key
98
- #
99
- # response = HTTParty.get(query)
100
- #
101
- # if response["success"]
102
- # #Assert: looks for the desired fields
103
- # fields.each_with_index do |assert, index|
104
- # response["data"].each do |search|
105
- # if search['name'] == assert
106
- # @field_key[index] = search['key']
107
- # end
108
- # end
109
- # end
110
- #
111
- # # Integrate: create missing fields
112
- # fields.each_with_index do |create, index|
113
- # if @field_key[index].blank?
114
- # @field_key[index] = create_field(app_key, create)
115
- # end
116
- # end
117
- #
118
- # #Hash the info
119
- # custom_field = Hash[fields.zip(@field_key.map \
120
- # {|i| i.include?(',') ? (i.split /, /) : i})] #/
121
- # else
122
- # if response["error"] == "You need to be authorized to make this request."
123
- # return false
124
- # end
125
- # end
126
- # #ship it back
127
- # return custom_field
128
- # end
129
-
130
- # ## even if populated the field key will always be replaced
131
- # def self.create_field(app_key, field_name)
132
- # field_api_key = false
133
- #
134
- # input_query = PIPEDRIVE_API + 'personFields?' + TOKEN + app_key
135
- #
136
- # response = HTTParty.post(input_query,
137
- # :body => {:name =>"#{field_name}",
138
- # :field_type => "varchar"},
139
- # :headers => HEADERS )
140
- #
141
- # unless response["data"] == nil
142
- # field_api_id = response["data"]["id"]
143
- #
144
- # key_query = PIPEDRIVE_API + 'personFields/'\
145
- # + field_api_id.to_s + "?" + TOKEN + app_key
146
- #
147
- # field_key_response = HTTParty.get(key_query)
148
- #
149
- # unless field_key_response["data"] == nil
150
- # field_api_key = field_key_response["data"]["key"]
151
- # end
152
- # end
153
- # return field_api_key
154
- # end
155
18
  end
@@ -78,33 +78,6 @@ module Rdgem
78
78
  return custom_field
79
79
  end
80
80
 
81
- # # adds a new field to the owner app_key's account
82
- # def self.add_field_to_user(app_key, field_name)
83
- # field_api_key = false
84
- #
85
- # input_query = PIPEDRIVE_API + 'personFields?' + TOKEN + app_key
86
- #
87
- # response = HTTParty.post(input_query,
88
- # :body => {:name =>"#{field_name}",
89
- # :field_type => "varchar"},
90
- # :headers => HEADERS )
91
- #
92
- # unless response["data"] == nil
93
- # field_api_id = response["data"]["id"]
94
- #
95
- # key_query = PIPEDRIVE_API + 'personFields/'\
96
- # + field_api_id.to_s + "?" + TOKEN + app_key
97
- #
98
- #
99
- # field_key_response = HTTParty.get(key_query)
100
- #
101
- # unless field_key_response["data"] == nil
102
- # field_api_key = field_key_response["data"]["key"]
103
- # end
104
- # end
105
- # return field_api_key
106
- # end
107
- #
108
81
  # removes a field from the owner app_key's account (used for testing only)
109
82
  def self.delete_field(app_key, field_id)
110
83
 
data/lib/rdgem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rdgem
2
- VERSION = "0.2.5"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gabriel