summaryrefslogtreecommitdiff
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <[email protected]>2020-09-30 18:21:27 -0400
committerHiroshi SHIBATA <[email protected]>2021-04-28 17:33:59 +0900
commit37b445eaeb9fdb5c717a32253d0d00c50a650b93 (patch)
tree295a4c580724d3499b3897880e58a8f961837d70 /lib/ostruct.rb
parent2afbe7113aceb5e3e1c63fe2778c875e975bacf3 (diff)
[ruby/ostruct] Compatibility with Ruby 2.5
https://github.com/ruby/ostruct/commit/ecd9fafdf8
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 5426457abe..581dd73ea7 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -220,7 +220,7 @@ class OpenStruct
private def is_method_protected!(name) # :nodoc:
if !respond_to?(name, true)
false
- elsif name.end_with?('!')
+ elsif name.match?(/!$/)
true
else
owner = method!(name).owner