CloudSesame 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eea978961d955956e55cf9c3dfdb3ec96817c7a
4
- data.tar.gz: 109b53d54f5d4871146661c136945ebe84283fa7
3
+ metadata.gz: e652837a674dc067f1330484f696ba6e5cefa439
4
+ data.tar.gz: 40b265eaf764e89e15a5074e51dea46dcbdd0cce
5
5
  SHA512:
6
- metadata.gz: 1417311e7e0584da0521a3eadbfb446dd4e31783d343b7464b652766265ac6121c75f8be853c4ba75679aac931faf15dae35d75b233cef993b7f8445e3716465
7
- data.tar.gz: 8198d9d6b27d7f68c587a3f4161cd87b1fb4a1d30d62fe4282759d91cdb4dea673ec7f5057eaa5e8c1f99c0c4f258733dd16ce6cc4e2e491fa19ffedc4346ae4
6
+ metadata.gz: f3b7685b103c802e5c336a34d44f72f0220a6cf74b2da2909760fc65e8ea17b660e42efcaa22a2a257d34513e4efbbeadbf4d0ff57fca967f1e8ece099209d94
7
+ data.tar.gz: 5e9707453aafaf01c0eb99d2b19f892504d5da3354658206cc7cd53cf6ea3ed55fe19e3f3c7d4b675a135d6b5926df031699ea54876e0ba964032317252f8f1a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- CloudSesame (0.3.2)
4
+ CloudSesame (0.3.3)
5
5
  aws-sdk (~> 2)
6
6
 
7
7
  GEM
data/cloud_sesame.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'CloudSesame'
3
- s.version = '0.3.2'
3
+ s.version = '0.3.3'
4
4
  s.date = '2016-01-20'
5
5
  s.summary = "AWS CloudSearch Query DSL"
6
6
  s.description = "AWS CloudSearch Query DSL"
@@ -3,14 +3,23 @@ module CloudSesame
3
3
  module DSL
4
4
  module ScopeMethods
5
5
 
6
- def scopes
7
- dsl_context[:scopes]
6
+ def scopes(name = nil, *args)
7
+ if (name && context_scopes && (callback = context_scopes[name])) || name.nil?
8
+ instance_exec(*args, &callback) if callback
9
+ dsl_return
10
+ else
11
+ raise NoMethodError, "scope[#{ name }] does not exist"
12
+ end
8
13
  end
9
14
 
10
15
  private
11
16
 
17
+ def context_scopes
18
+ dsl_context[:scopes]
19
+ end
20
+
12
21
  def method_missing(name, *args, &block)
13
- if scopes && (callback = scopes[name])
22
+ if context_scopes && (callback = context_scopes[name])
14
23
  instance_exec *args, &callback
15
24
  dsl_return
16
25
  else
@@ -5,7 +5,7 @@ module CloudSesame
5
5
 
6
6
  def sort(input = false)
7
7
  if input.is_a? Hash
8
- request.sort = input
8
+ request.sort.sorting_attributes = input
9
9
  return self
10
10
  elsif input
11
11
  request.sort[input]
@@ -3,7 +3,7 @@ module CloudSesame
3
3
  module Node
4
4
  class Sort < Abstract
5
5
 
6
- attr_reader :sorting_attributes
6
+ attr_writer :sorting_attributes
7
7
 
8
8
  def sorting_attributes
9
9
  @sorting_attributes ||= deserialize context[:sort]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CloudSesame
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chu