1

一切如下图所示:

# below is a common lib definition.
module SomeLib
    extend ActiveSupport::Concern

    included do
        puts 'executing predefined block from lib'
    end
end

# I want to expand the lib through my logic 
module SomeLib
    # errors: ActiveSupport::Concern::MultipleIncludedBlocks 
    included do
        puts 'executing some actions defined by me'
    end
end

那么当该模块中定义了一个额外的包含块时,如何定义额外的包含块?

4

0 回答 0