Class: ActiveModel::Type::Registration
- Inherits:
-
Object
- Object
- ActiveModel::Type::Registration
- Defined in:
- lib/active_model/type/registry.rb
Instance Method Summary collapse
- #call(_registry, *args) ⇒ Object
-
#initialize(name, block) ⇒ Registration
constructor
Options must be taken because of bugs.ruby-lang.org/issues/10856.
- #matches?(type_name, *args, **kwargs) ⇒ Boolean
Constructor Details
#initialize(name, block) ⇒ Registration
Options must be taken because of bugs.ruby-lang.org/issues/10856
49 50 51 52 |
# File 'lib/active_model/type/registry.rb', line 49 def initialize(name, block, **) @name = name @block = block end |
Instance Method Details
#call(_registry, *args) ⇒ Object
54 55 56 |
# File 'lib/active_model/type/registry.rb', line 54 def call(_registry, *args) block.call(*args) end |
#matches?(type_name, *args, **kwargs) ⇒ Boolean
59 60 61 |
# File 'lib/active_model/type/registry.rb', line 59 def matches?(type_name, *args, **kwargs) type_name == name end |