instance method
method_missing
Ruby on Rails edge
Since v3.0.20Signature
method_missing(method, arg = nil)
A single optional argument rather than a splat: reads are by far the most common call and must not allocate.
Parameters
-
methodreq -
argopt = nil
Source
# File activesupport/lib/active_support/ordered_options.rb, line 59
def method_missing(method, arg = nil)
if method.end_with?("=")
self[method.name.chomp("=")] = arg
elsif method.end_with?("!")
name_string = method.name.chomp("!")
self[name_string].presence || raise(KeyError.new(":#{name_string} is blank"))
else
self[method]
end
end
Defined in activesupport/lib/active_support/ordered_options.rb line 59
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::OrderedOptions