instance method method_missing

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

method_missing(method_name, *args, **kwargs)

No documentation comment.

Parameters

method_name req
args rest
kwargs keyrest
Source
# File activemodel/lib/active_model/schematized_json.rb, line 81
        def method_missing(method_name, *args, **kwargs)
          key = method_name.to_s.remove(/(\?|=)/)

          if @schema.key? key.to_sym
            if method_name.ends_with?("?")
              @data[key].present?
            elsif method_name.ends_with?("=")
              @data[key] = lookup_schema_type_for(key).cast(args.first)
            else
              @data[key]
            end
          else
            super
          end
        end

Defined in activemodel/lib/active_model/schematized_json.rb line 81 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::SchematizedJson::DataAccessor

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close