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 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
- @value.has_key?(key) && !!self[key]
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]
@@ -1,3 +1,3 @@
1
1
  module Deepstruct
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -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.3
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: 4197967560630197465
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: 4197967560630197465
87
+ hash: 495989173450393411
88
88
  requirements: []
89
89
  rubyforge_project: deepstruct
90
90
  rubygems_version: 1.8.24