Skip to content

Commit

Permalink
Fix respond_to_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
gbmoretti committed Oct 2, 2023
1 parent 8033627 commit c7b0a3d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/ostruct-sanitizer/lib/ostruct/sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def initialize(attrs = {})
# @param [Symbol] method the missing method
# @param [Array<Any>] args the method's arguments list
#
def method_missing(method, *args)
def method_missing(method, *args) # rubocop:disable Style/MissingRespondToMissing
# Give OpenStruct a chance to create getters and setters for the
# corresponding field
super method, *args
Expand All @@ -55,10 +55,6 @@ def method_missing(method, *args)
send(method, args[0])
end

def respond_to_missing?(method)
setter?(method)
end

# Set attribute's value via setter so that any existing sanitization rules
# may be applied
#
Expand Down

0 comments on commit c7b0a3d

Please sign in to comment.