instance method
included
Ruby on Rails 7.0.10
Since v3.0.20Signature
included(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 included block, it raises an exception.
Parameters
-
baseopt = nil -
blockblock
Source
# File activesupport/lib/active_support/concern.rb, line 156
def included(base = nil, &block)
if base.nil?
if instance_variable_defined?(:@_included_block)
if @_included_block.source_location != block.source_location
raise MultipleIncludedBlocks
end
else
@_included_block = block
end
else
super
end
end
Defined in activesupport/lib/active_support/concern.rb line 156
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Concern