instance method
prepended
Ruby on Rails 8.0.4
Since v6.1.7.10Signature
prepended(base = nil, &block)
Evaluate given block in context of base class, so that you can write class macros here. When you define more than one prepended block, it raises an exception.
Parameters
-
baseopt = nil -
blockblock
Source
# File activesupport/lib/active_support/concern.rb, line 175
def prepended(base = nil, &block)
if base.nil?
if instance_variable_defined?(:@_prepended_block)
if @_prepended_block.source_location != block.source_location
raise MultiplePrependBlocks
end
else
@_prepended_block = block
end
else
super
end
end
Defined in activesupport/lib/active_support/concern.rb line 175
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Concern