deepstruct 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/deepstruct.rb +1 -1
- data/lib/deepstruct/version.rb +1 -1
- data/spec/deepstruct_spec.rb +6 -0
- metadata +3 -3
data/lib/deepstruct.rb
CHANGED
@@ -59,7 +59,7 @@ module DeepStruct
|
|
59
59
|
method = method.to_s
|
60
60
|
if method.chomp!('?')
|
61
61
|
key = method.to_sym
|
62
|
-
|
62
|
+
self.has_key?(key) && !!self[key]
|
63
63
|
elsif method.chomp!('=')
|
64
64
|
raise ArgumentError, "wrong number of arguments (#{arg_count} for 1)", caller(1) if args.length != 1
|
65
65
|
self[method] = args[0]
|
data/lib/deepstruct/version.rb
CHANGED
data/spec/deepstruct_spec.rb
CHANGED
@@ -124,4 +124,10 @@ describe DeepStruct do
|
|
124
124
|
its(:d?) { should be_true }
|
125
125
|
end
|
126
126
|
|
127
|
+
describe "predicate methods are indifferent" do
|
128
|
+
subject { DeepStruct.wrap({"a" => false, "b" => true}) }
|
129
|
+
its(:a?) { should be_false }
|
130
|
+
its(:b?) { should be_true }
|
131
|
+
end
|
132
|
+
|
127
133
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deepstruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -75,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
segments:
|
77
77
|
- 0
|
78
|
-
hash:
|
78
|
+
hash: 495989173450393411
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
none: false
|
81
81
|
requirements:
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
segments:
|
86
86
|
- 0
|
87
|
-
hash:
|
87
|
+
hash: 495989173450393411
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project: deepstruct
|
90
90
|
rubygems_version: 1.8.24
|