Make register_block_for
private
This commit is contained in:
parent
7bb28a0df2
commit
9ebb3558f4
@ -178,17 +178,6 @@ def generate_railtie_name(string) #:nodoc:
|
||||
ActiveSupport::Inflector.underscore(string).tr("/", "_")
|
||||
end
|
||||
|
||||
# receives an instance variable identifier, set the variable value if is
|
||||
# blank and append given block to value, which will be used later in
|
||||
# `#each_registered_block(type, &block)`
|
||||
def register_block_for(type, &blk)
|
||||
var_name = "@#{type}"
|
||||
blocks = instance_variable_get(var_name) || instance_variable_set(var_name, [])
|
||||
blocks << blk if blk
|
||||
blocks
|
||||
end
|
||||
|
||||
|
||||
# If the class method does not have a method, then send the method call
|
||||
# to the Railtie instance.
|
||||
def method_missing(name, *args, &block)
|
||||
@ -198,6 +187,17 @@ def method_missing(name, *args, &block)
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# receives an instance variable identifier, set the variable value if is
|
||||
# blank and append given block to value, which will be used later in
|
||||
# `#each_registered_block(type, &block)`
|
||||
def register_block_for(type, &blk)
|
||||
var_name = "@#{type}"
|
||||
blocks = instance_variable_get(var_name) || instance_variable_set(var_name, [])
|
||||
blocks << blk if blk
|
||||
blocks
|
||||
end
|
||||
end
|
||||
|
||||
delegate :railtie_name, to: :class
|
||||
|
Loading…
Reference in New Issue
Block a user