scope_composer 0.3.1 → 0.3.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWZiN2E2N2U1MTQ2YjQ3MTY3MGI5ZWE4NTQ4MTMwYjIxZmU1MTQ5Mw==
4
+ MjhkNmJhMTM5OGNlMTBlZmNhNTcwNWI0ZWZkODEyZmM3YzUzOWE5Nw==
5
5
  data.tar.gz: !binary |-
6
- NmY5ZTUyYjE1MzE0YjM2ZjNmM2NiYjgyZDU2NTY5NmQxNDU5NmFlNA==
6
+ ZjlkODgxODVjYmQwNzAxNDg1YmFjNDFiMjI0ZGQzZmIzOGY3MDc1NQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Njg2NjA0MDVhZDAxOGE2ZWFlNzNmZTJkMmM4MTUwOTZlY2E3NTdkODdhYTAw
10
- Yjk5NjE1N2FhYmZkMWE4ZDVmYzAxM2M3Njk3YzdlZWU0MTY0OGZjMTJiYWM2
11
- M2I3NTBlYjVjZTc0MDAwNjYwY2RjYWI2YTUwMzNhNzM0ZjA0ZmU=
9
+ NmQwYjJlZTlhODdkMjJlYzc1ZjAxNmI0NmYyNTBmOWQ3NzJhYWEyYzZlZTdi
10
+ Nzk2NTY3NjM3YzI2MThhNDE4ZGY4NzViNTg5MTcxNDE1M2M0ODA0ODFkYmI1
11
+ ZDM1MzdjZmJiOGFhMmE2OGJhZTg1MDU2NzQ1MzhjODQ5NjhlNzI=
12
12
  data.tar.gz: !binary |-
13
- NGY5NDg4ZTM1ZWZkZThhYTQ0YzAxM2EyYTRmZWI5NzMzMGRjNGQ0OGMwMjI2
14
- ZTVhN2IzZGZjNjY5MjcyZDVjMTE3ZWE3YzQyYmQyMWE4ZWQ5OTU4ZmEyZjBm
15
- Zjg2Njc1YWExYmI1MjA0OWU0NTAzYjU5ZGRiYmFlNzMzODg3OGM=
13
+ NjEwZDA5ZWJlYzdhNzI2ZjMzMGMwMzhiOWNjYTBkMjJmNGUyZTk4YWE4OTkz
14
+ NzUyNjA5Yjg2OTAzYTQ1MTEwYTVjMmIyOTAyZDA1MjU0ZmFlOTlkNjVmNjUw
15
+ MTcyOTc3NGI2MzE2MGIzMTM5OTlhMGFkMzMxY2U3ZGViMzkzMzI=
data/UPGRADE.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.3.2
2
+
3
+ * scope given no arguments returns value
4
+
5
+
1
6
  ## 0.3.1
2
7
 
3
8
  * scope given multiple arguments will assign an array instead of a value
@@ -116,7 +116,9 @@ class Scope
116
116
  # define method
117
117
  define_method(name) do |*args|
118
118
  # init
119
- values = args.count == 1 ? args.first : args
119
+ values = nil
120
+ values = args.first if args.count == 1
121
+ values = args if args.count > 1
120
122
  # if no value is given, act as a getter
121
123
  return scope_attributes[name] if values.nil?
122
124
  # otherwise set the value
@@ -1,3 +1,3 @@
1
1
  module ScopeComposer
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -49,6 +49,8 @@ describe ScopeComposer::Model do
49
49
 
50
50
  its(:scope_attributes){ should eq({ limit: 10, select: [:key1, :key2, :key3] }) }
51
51
 
52
+ its(:limit){ should eq 10 }
53
+ its(:select){ should eq [:key1, :key2, :key3] }
52
54
  end
53
55
 
54
56
  describe "#where" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scope_composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher