landslider 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -0
- data/VERSION.yml +1 -1
- data/landslider.gemspec +2 -2
- data/lib/landslider.rb +20 -4
- data/test/landslider_test.rb +11 -1
- metadata +2 -2
data/README.rdoc
CHANGED
data/VERSION.yml
CHANGED
data/landslider.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{landslider}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jay Prall"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-29}
|
13
13
|
s.description = %q{Landslider is a ruby interface to the Landslide SOAP-based API}
|
14
14
|
s.email = %q{jay@j4y.net}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/landslider.rb
CHANGED
@@ -73,6 +73,7 @@ class Landslider < Handsoap::Service
|
|
73
73
|
response = invoke("getAccountById", :soap_action => :none) do |message|
|
74
74
|
message.add 'accountId', account_id
|
75
75
|
end
|
76
|
+
|
76
77
|
node = response.document.xpath('//ns:getAccountByIdResponse', ns)
|
77
78
|
parse_get_account_by_id_result(node)
|
78
79
|
end
|
@@ -153,7 +154,7 @@ class Landslider < Handsoap::Service
|
|
153
154
|
lr.add 'firstResultPosition', first_result_position
|
154
155
|
lr.add 'totalResultsRequested', total_results_requested
|
155
156
|
}
|
156
|
-
end
|
157
|
+
end
|
157
158
|
node = response.document.xpath('//ns:getLeadsResponse', ns)
|
158
159
|
parse_get_leads_result(node)
|
159
160
|
end
|
@@ -189,6 +190,15 @@ class Landslider < Handsoap::Service
|
|
189
190
|
parse_get_opportunity_notes_result(node)
|
190
191
|
end
|
191
192
|
|
193
|
+
def get_user_information(session_id, user_id)
|
194
|
+
|
195
|
+
self.session_id = session_id
|
196
|
+
response = invoke("getUserInformation", :soap_action => :none) do |message|
|
197
|
+
message.add 'userId', user_id
|
198
|
+
end
|
199
|
+
node = response.document.xpath('//ns:getUserInformationResponse', ns)
|
200
|
+
parse_get_user_information_by_id_result(node)
|
201
|
+
end
|
192
202
|
|
193
203
|
def get_user_information_by_id(session_id, user_id)
|
194
204
|
self.session_id = session_id
|
@@ -368,6 +378,7 @@ class Landslider < Handsoap::Service
|
|
368
378
|
:account_owner => xml_to_str(node, './accountOwner/text()'),
|
369
379
|
:url => xml_to_str(node, './url/text()'),
|
370
380
|
:phone => xml_to_str(node, './phone/text()'),
|
381
|
+
:fax => xml_to_str(node, './fax/text()'),
|
371
382
|
:main_address => parse_address(node.xpath('./mainAddress')),
|
372
383
|
:shipping_address => parse_address(node.xpath('./shippingAddress')),
|
373
384
|
:billing_address => parse_address(node.xpath('./billingAddress')),
|
@@ -475,9 +486,16 @@ class Landslider < Handsoap::Service
|
|
475
486
|
def parse_lead(node)
|
476
487
|
{
|
477
488
|
:name => xml_to_str(node, './name/text()'),
|
489
|
+
:lead_source => xml_to_str(node, './leadSource/source/text()'),
|
490
|
+
:lead_rating => xml_to_str(node, './leadRating/rating/text()'),
|
491
|
+
:lead_status => xml_to_str(node, './leadStatus/status/text()'),
|
492
|
+
:account_id => xml_to_int(node, './accountId/text()'),
|
493
|
+
:primary_owner_id => xml_to_int(node, './primaryOwnerId/text()'),
|
478
494
|
:ok_to_call => xml_to_bool(node, './okToCall/text()'),
|
479
495
|
:ok_to_email => xml_to_bool(node, './okToEmail/text()'),
|
480
|
-
:hot => xml_to_bool(node, './hot/text()')
|
496
|
+
:hot => xml_to_bool(node, './hot/text()'),
|
497
|
+
:converted => xml_to_bool(node, './converted/text()')
|
498
|
+
|
481
499
|
}
|
482
500
|
end
|
483
501
|
|
@@ -501,5 +519,3 @@ class Landslider < Handsoap::Service
|
|
501
519
|
end
|
502
520
|
|
503
521
|
end
|
504
|
-
|
505
|
-
|
data/test/landslider_test.rb
CHANGED
@@ -49,6 +49,8 @@ class LandsliderTest < Test::Unit::TestCase
|
|
49
49
|
assert_not_nil result
|
50
50
|
assert_equal false, result[:error]
|
51
51
|
assert_not_nil result[:account]
|
52
|
+
assert_not_nil result[:account][:fax]
|
53
|
+
|
52
54
|
end
|
53
55
|
|
54
56
|
def test_landslider_account_custom_fields
|
@@ -117,7 +119,7 @@ class LandsliderTest < Test::Unit::TestCase
|
|
117
119
|
|
118
120
|
def test_landslider_get_leads
|
119
121
|
result = Landslider.get_leads($sid, 51857822)
|
120
|
-
|
122
|
+
|
121
123
|
validate_standard_api_result result
|
122
124
|
assert_not_nil result[:leads]
|
123
125
|
assert_equal Array, result[:leads].class
|
@@ -141,6 +143,14 @@ class LandsliderTest < Test::Unit::TestCase
|
|
141
143
|
validate_at_least_one_note_returned result
|
142
144
|
end
|
143
145
|
|
146
|
+
def test_landslider_get_user_information
|
147
|
+
result = Landslider.get_user_information($sid, 'jayp@landslide.com')
|
148
|
+
|
149
|
+
assert_not_nil result
|
150
|
+
assert_equal false, result[:error]
|
151
|
+
assert_not_nil result[:employee]
|
152
|
+
assert_not_nil result[:employee][:user_id]
|
153
|
+
end
|
144
154
|
|
145
155
|
def test_landslider_get_user_information_by_id
|
146
156
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: landslider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jay Prall
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-29 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|