bound 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bound.rb +7 -13
- data/lib/bound/version.rb +1 -1
- data/spec/bound_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e07d85a571ce0e21e25fe723b5ab06b6d97344a0
|
4
|
+
data.tar.gz: ecc7ccb58e70d4a9d07a5b66055e8b90345e018d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d3d35a5b23cdcdadb628e3daf2e41fc90cb937c16d4762bd023b0ba4638ce34f35c83fb8a247e0858b5a14c44b737a9b5e8ddf7a07b71f8217a05997126740
|
7
|
+
data.tar.gz: 3255a3b9c99ef7243decccbd7a27ee80a20bb01bbb3f883396cb45de32fc36ebe764a86f7e993e363bd85080ce2d2a6890478a957591c8eab463b4d2523b6569
|
data/lib/bound.rb
CHANGED
@@ -18,23 +18,17 @@ class Bound
|
|
18
18
|
attr_accessor :attributes, :optionals
|
19
19
|
|
20
20
|
def set_attributes(*attributes)
|
21
|
-
attributes = attributes
|
21
|
+
self.attributes = attributes
|
22
|
+
attr_accessor *attributes
|
22
23
|
|
23
|
-
optionals =
|
24
|
+
self.optionals = []
|
25
|
+
end
|
24
26
|
|
27
|
+
def optional(*optionals)
|
25
28
|
self.optionals = optionals
|
26
|
-
attr_accessor
|
27
|
-
|
28
|
-
self.attributes = attributes
|
29
|
-
attr_accessor(*attributes)
|
30
|
-
end
|
29
|
+
attr_accessor *optionals
|
31
30
|
|
32
|
-
|
33
|
-
if attributes.last.kind_of? Hash
|
34
|
-
attributes.pop[:optional]
|
35
|
-
else
|
36
|
-
[]
|
37
|
-
end
|
31
|
+
self
|
38
32
|
end
|
39
33
|
|
40
34
|
alias :build :new
|
data/lib/bound/version.rb
CHANGED
data/spec/bound_spec.rb
CHANGED