saasu2 0.1.2 → 0.1.3

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: 04c42e83273f4aaa849e084a3f85fe1d9ca19774
4
- data.tar.gz: d73f74df0a87b3a0b463b1067f065dd912b6435f
3
+ metadata.gz: 1affbc76306877b1478cd092e7f30cee9dc54eb4
4
+ data.tar.gz: 97086f72357ed3b063a6667f8c3a6d47d9923044
5
5
  SHA512:
6
- metadata.gz: 2d18a43735d99b4b4a5b818065d6d272079b5d35fdabfa6ad641d02d5d42a9411c5ed7001a2967c57bca36d279a3586ed582ee4f0325aa9f830493d25f79da47
7
- data.tar.gz: a158fd956c0e7e482db051cd3d4cc876757045df7662050a6c604ae51da79e9a253118d7765c187a6aa4a6f6736cf504e2999a8bb9317bc04823b470d3379150
6
+ metadata.gz: c6c4168807cc9dd04660890381a0aacb6259884f43ee21a0f7ef973893323310644101564e4dec06d29c05e58d6cdca67441ddc5546c514741aff6d387f523c4
7
+ data.tar.gz: 39d4bc50bed5d3088fa930c84669ac354f8cdeda4de2a2d2f9b514ee3cd2381f3379fe54ae56c3ca29dc36e6e203c2d293b456b7a6c0a7e6954dc961575529b7
data/README.md CHANGED
@@ -77,7 +77,7 @@ contact['GivenName'] = 'John'
77
77
  contact.attributes
78
78
 
79
79
  # Search. Available scopes: All, Transactions, Contacts, InventoryItems.
80
- query = Saasu::Search.new(keywords: 'Book', scope: 'All')
80
+ query = Saasu::Search.new('Book', 'InventoryItems')
81
81
  query.perform
82
82
 
83
83
  query.contacts
data/lib/saasu/search.rb CHANGED
@@ -3,7 +3,7 @@ module Saasu
3
3
  VALID_SCOPES = %W(All Transactions Contacts InventoryItems)
4
4
  attr_accessor :scope, :keywords
5
5
 
6
- def initialize(scope: nil, keywords:)
6
+ def initialize(keywords, scope = 'All')
7
7
  @scope = scope
8
8
  @keywords = keywords
9
9
 
@@ -35,11 +35,7 @@ module Saasu
35
35
 
36
36
  private
37
37
  def perform_search!
38
- @search_results = Saasu::Client.request(:get, 'search', { Scope: scope, Keywords: @keywords, IncludeSearchTermHighlights: false })
39
- end
40
-
41
- def scope
42
- @scope ||= 'All'
38
+ @search_results = Saasu::Client.request(:get, 'search', { Scope: @scope, Keywords: @keywords, IncludeSearchTermHighlights: false })
43
39
  end
44
40
 
45
41
  def search_results
@@ -47,7 +43,7 @@ module Saasu
47
43
  end
48
44
 
49
45
  def validate_scope!
50
- unless scope.in? VALID_SCOPES
46
+ unless @scope.in? VALID_SCOPES
51
47
  raise "Invalid scope argument. Valid values are: #{VALID_SCOPES.join(', ')}"
52
48
  end
53
49
  end
data/lib/saasu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saasu
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saasu2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sinenko