summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ostruct.rb1
-rw-r--r--test/ostruct/test_ostruct.rb1
-rw-r--r--version.h2
3 files changed, 3 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index bae0f3aac5..d2375a2572 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -134,6 +134,7 @@ class OpenStruct
def each_pair
return to_enum(__method__) { @table.size } unless block_given?
@table.each_pair{|p| yield p}
+ self
end
#
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 0504efbf76..c4cb0c289c 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -140,6 +140,7 @@ class TC_OpenStruct < Test::Unit::TestCase
def test_each_pair
h = {name: "John Smith", age: 70, pension: 300}
os = OpenStruct.new(h)
+ assert_same os, os.each_pair{ }
assert_equal '#<Enumerator: #<OpenStruct name="John Smith", age=70, pension=300>:each_pair>', os.each_pair.inspect
assert_equal [[:name, "John Smith"], [:age, 70], [:pension, 300]], os.each_pair.to_a
assert_equal 3, os.each_pair.size
diff --git a/version.h b/version.h
index bb750e62b7..cbd6bb6eba 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.3.3"
#define RUBY_RELEASE_DATE "2017-03-28"
-#define RUBY_PATCHLEVEL 287
+#define RUBY_PATCHLEVEL 288
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 3