Make register_block_for private

This commit is contained in:
Arthur Neves 2016-11-01 19:24:07 -04:00
parent 7bb28a0df2
commit 9ebb3558f4
No known key found for this signature in database
GPG Key ID: 04A390FB1E433E17

@ -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