landslider 0.5.5 → 0.5.6

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.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 5
4
- :patch: 5
4
+ :patch: 6
5
5
  :build:
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.5.5"
8
+ s.version = "0.5.6"
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-05-06}
12
+ s.date = %q{2011-05-07}
13
13
  s.default_executable = %q{generate_api_key.rb}
14
14
  s.description = %q{Landslider is a ruby interface to the Landslide SOAP-based API}
15
15
  s.email = %q{jay@j4y.net}
@@ -42,15 +42,6 @@ Gem::Specification.new do |s|
42
42
  s.require_paths = ["lib"]
43
43
  s.rubygems_version = %q{1.6.2}
44
44
  s.summary = %q{Landslide Ruby}
45
- s.test_files = [
46
- "test/landslider_test.rb",
47
- "test/test_helper.rb",
48
- "test/ws_account_note_search_test.rb",
49
- "test/ws_contact_note_search_test.rb",
50
- "test/ws_lead_note_search_test.rb",
51
- "test/ws_opportunity_note_search_test.rb",
52
- "test/ws_search_test.rb"
53
- ]
54
45
 
55
46
  if s.respond_to? :specification_version then
56
47
  s.specification_version = 3
data/lib/landslider.rb CHANGED
@@ -2,6 +2,121 @@
2
2
  require 'handsoap'
3
3
 
4
4
  class Landslider < Handsoap::Service
5
+
6
+ class WsSearch
7
+ attr_writer :first_result_position, :total_results_requested, :updated_on
8
+
9
+ def initialize
10
+ end
11
+
12
+ # @param [Handsoap::XmlMason::Node] msg
13
+ # @return [Handsoap::XmlMason::Node]
14
+ def soapify_for(msg)
15
+ msg.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
16
+ msg.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
17
+ msg.add 'updatedOn', @updated_on unless @updated_on.nil?
18
+ end
19
+
20
+ end
21
+
22
+ class WsSearchCriterion
23
+ attr_reader :field_id, :operator, :query_value
24
+
25
+ def initialize(field_id, operator, query_value)
26
+ @field_id = field_id
27
+ @operator = operator
28
+ @query_value = query_value
29
+ end
30
+
31
+ # @param [Handsoap::XmlMason::Node] msg
32
+ # @return [Handsoap::XmlMason::Node]
33
+ def soapify_for(msg)
34
+ msg.add('searchCriteria') { |crit|
35
+ crit.add 'fieldId', @field_id
36
+ crit.add 'operator', @operator
37
+ crit.add 'queryValue', @query_value unless @query_value.nil?
38
+ }
39
+ end
40
+ end
41
+
42
+ class WsAccountNoteSearch < WsSearch
43
+ attr_reader :account_id
44
+
45
+ # alias :super_soapify_for :soapify_for
46
+
47
+ def initialize(account_id)
48
+ @account_id = account_id
49
+ end
50
+
51
+ # @param [Handsoap::XmlMason::Node] msg
52
+ # @return [Handsoap::XmlMason::Node]
53
+ def soapify_for(msg)
54
+ msg.add('accountNoteSearch') { |crit|
55
+ crit.add 'accountId', @account_id
56
+ crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
57
+ crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
58
+ crit.add 'updatedOn', @updated_on unless @updated_on.nil?
59
+ }
60
+ end
61
+ end
62
+
63
+ class WsContactNoteSearch < WsSearch
64
+ attr_reader :contact_id
65
+
66
+ def initialize(contact_id)
67
+ @contact_id = contact_id
68
+ end
69
+
70
+ # @param [Handsoap::XmlMason::Node] msg
71
+ # @return [Handsoap::XmlMason::Node]
72
+ def soapify_for(msg)
73
+ msg.add('contactNote') { |crit|
74
+ crit.add 'contactId', @contact_id
75
+ crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
76
+ crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
77
+ crit.add 'updatedOn', @updated_on unless @updated_on.nil?
78
+ }
79
+ end
80
+ end
81
+
82
+ class WsLeadNoteSearch < WsSearch
83
+ attr_reader :lead_id
84
+
85
+ def initialize(lead_id)
86
+ @lead_id = lead_id
87
+ end
88
+
89
+ # @param [Handsoap::XmlMason::Node] msg
90
+ # @return [Handsoap::XmlMason::Node]
91
+ def soapify_for(msg)
92
+ msg.add('leadNote') { |crit|
93
+ crit.add 'leadId', @lead_id
94
+ crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
95
+ crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
96
+ crit.add 'updatedOn', @updated_on unless @updated_on.nil?
97
+ }
98
+ end
99
+
100
+ end
101
+
102
+ class WsOpportunityNoteSearch < WsSearch
103
+ attr_reader :opportunity_id
104
+
105
+ def initialize(opportunity_id)
106
+ @opportunity_id = opportunity_id
107
+ end
108
+
109
+ # @param [Handsoap::XmlMason::Node] msg
110
+ # @return [Handsoap::XmlMason::Node]
111
+ def soapify_for(msg)
112
+ msg.add('opportunityNote') { |crit|
113
+ crit.add 'opportunityId', @opportunity_id
114
+ crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
115
+ crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
116
+ crit.add 'updatedOn', @updated_on unless @updated_on.nil?
117
+ }
118
+ end
119
+ end
5
120
 
6
121
  LS_API_NAMESPACE='http://www.landslide.com/webservices/SoapService'
7
122
  LS_API_ENDPOINT = {
@@ -595,106 +710,5 @@ class Landslider < Handsoap::Service
595
710
  :start_date => xml_to_date(node, './startDate/text()')
596
711
  }
597
712
  end
598
-
599
- class WsSearch
600
- attr_reader :field_id, :operator, :query_value
601
-
602
- def initialize(field_id, operator, query_value)
603
- @field_id = field_id
604
- @operator = operator
605
- @query_value = query_value
606
- end
607
-
608
- # @param [Handsoap::XmlMason::Node] msg
609
- # @return [Handsoap::XmlMason::Node]
610
- def soapify_for(msg)
611
- msg.add('searchCriteria') { |crit|
612
- crit.add 'fieldId', @field_id
613
- crit.add 'operator', @operator
614
- crit.add 'queryValue', @query_value unless @query_value.nil?
615
- }
616
- end
617
- end
618
-
619
- class WsAccountNoteSearch
620
- attr_reader :account_id
621
- attr_writer :first_result_position, :total_results_requested, :updated_on
622
-
623
- def initialize(account_id)
624
- @account_id = account_id
625
- end
626
-
627
- # @param [Handsoap::XmlMason::Node] msg
628
- # @return [Handsoap::XmlMason::Node]
629
- def soapify_for(msg)
630
- msg.add('accountNoteSearch') { |crit|
631
- crit.add 'accountId', @account_id
632
- crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
633
- crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
634
- crit.add 'updatedOn', @updated_on unless @updated_on.nil?
635
- }
636
- end
637
- end
638
-
639
- class WsContactNoteSearch
640
- attr_reader :contact_id
641
- attr_writer :first_result_position, :total_results_requested, :updated_on
642
-
643
- def initialize(contact_id)
644
- @contact_id = contact_id
645
- end
646
-
647
- # @param [Handsoap::XmlMason::Node] msg
648
- # @return [Handsoap::XmlMason::Node]
649
- def soapify_for(msg)
650
- msg.add('contactNote') { |crit|
651
- crit.add 'contactId', @contact_id
652
- crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
653
- crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
654
- crit.add 'updatedOn', @updated_on unless @updated_on.nil?
655
- }
656
- end
657
- end
658
-
659
- class WsLeadNoteSearch
660
- attr_reader :lead_id
661
- attr_writer :first_result_position, :total_results_requested, :updated_on
662
-
663
- def initialize(lead_id)
664
- @lead_id = lead_id
665
- end
666
-
667
- # @param [Handsoap::XmlMason::Node] msg
668
- # @return [Handsoap::XmlMason::Node]
669
- def soapify_for(msg)
670
- msg.add('leadNote') { |crit|
671
- crit.add 'leadId', @lead_id
672
- crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
673
- crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
674
- crit.add 'updatedOn', @updated_on unless @updated_on.nil?
675
- }
676
- end
677
-
678
- end
679
-
680
- class WsOpportunityNoteSearch
681
- attr_reader :opportunity_id
682
- attr_writer :first_result_position, :total_results_requested, :updated_on
683
-
684
- def initialize(opportunity_id)
685
- @opportunity_id = opportunity_id
686
- end
687
-
688
- # @param [Handsoap::XmlMason::Node] msg
689
- # @return [Handsoap::XmlMason::Node]
690
- def soapify_for(msg)
691
- msg.add('opportunityNote') { |crit|
692
- crit.add 'opportunityId', @opportunity_id
693
- crit.add 'firstResultPosition', @first_result_position || DEFAULT_FIRST_RESULT_POSITION
694
- crit.add 'totalResultsRequested', @total_results_requested || DEFAULT_TOTAL_RESULTS_REQUESTED
695
- crit.add 'updatedOn', @updated_on unless @updated_on.nil?
696
- }
697
- end
698
- end
699
713
 
700
714
  end
@@ -11,7 +11,7 @@ class WsAccountNoteSearchTest < Test::Unit::TestCase
11
11
  search = Landslider::WsAccountNoteSearch.new(55647822)
12
12
  result = Landslider.get_account_notes($sid3, search)
13
13
  assert_equal false, result[:error]
14
- assert_equal 7, result[:results_returned]
14
+ assert_equal 8, result[:results_returned]
15
15
  end
16
16
 
17
17
  def test_account_note_search_limit_by_updated_on
@@ -8,7 +8,7 @@ class WsSearchTest < Test::Unit::TestCase
8
8
  end
9
9
 
10
10
  def test_ws_search_object
11
- search = Landslider::WsSearch.new('AccountName', 'Equals', 'Boston')
11
+ search = Landslider::WsSearchCriterion.new('AccountName', 'Equals', 'Boston')
12
12
  assert_equal 'AccountName', search.field_id
13
13
  assert_equal 'Equals', search.operator
14
14
  assert_equal 'Boston', search.query_value
@@ -22,7 +22,7 @@ class WsSearchTest < Test::Unit::TestCase
22
22
  end
23
23
 
24
24
  def test_get_accounts_with_search_criteria
25
- search = Landslider::WsSearch.new('AccountName', 'Equals', 'Boston')
25
+ search = Landslider::WsSearchCriterion.new('AccountName', 'Equals', 'Boston')
26
26
  result = Landslider.get_accounts($sid2, 1, 25, search)
27
27
 
28
28
  assert_equal false, result[:error]
@@ -38,7 +38,7 @@ class WsSearchTest < Test::Unit::TestCase
38
38
 
39
39
  def test_get_opportunities_with_search_criteria
40
40
  target_phase_name = 'Prospect'
41
- search = Landslider::WsSearch.new('CurrentPhaseName', 'Contains', target_phase_name)
41
+ search = Landslider::WsSearchCriterion.new('CurrentPhaseName', 'Contains', target_phase_name)
42
42
  result = Landslider.get_opportunities($sid2, 1, 25, search)
43
43
 
44
44
  assert_equal false, result[:error]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: landslider
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.5
5
+ version: 0.5.6
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-05-06 00:00:00 -04:00
13
+ date: 2011-05-07 00:00:00 -04:00
14
14
  default_executable: generate_api_key.rb
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -112,11 +112,5 @@ rubygems_version: 1.6.2
112
112
  signing_key:
113
113
  specification_version: 3
114
114
  summary: Landslide Ruby
115
- test_files:
116
- - test/landslider_test.rb
117
- - test/test_helper.rb
118
- - test/ws_account_note_search_test.rb
119
- - test/ws_contact_note_search_test.rb
120
- - test/ws_lead_note_search_test.rb
121
- - test/ws_opportunity_note_search_test.rb
122
- - test/ws_search_test.rb
115
+ test_files: []
116
+