Sha256: caeee97fd3426a066125cf77d869dfbead0b07bd53da40e90d53f1826c9b3021
Contents?: true
Size: 963 Bytes
Versions: 21
Compression:
Stored size: 963 Bytes
Contents
module Hanami # @api private module Config # Collects all the settings for a given framework configuration and then # forwards them when the application is loaded. # # @since 0.2.0 # @api private class FrameworkConfiguration < BasicObject # @since 0.2.0 # @api private def initialize(&blk) @blocks = [blk || ::Proc.new { }] @settings = [] end # @since 0.2.0 # @api private def __apply(configuration) @blocks.compact.each do |blk| configuration.instance_eval(&blk) end @settings.each do |(m, args, blk)| configuration.public_send(m, *args, &blk) end end # @since 0.6.0 # @api private def __add(&blk) @blocks << blk self end # @since 0.2.0 # @api private def method_missing(m, *args, &blk) @settings.push([m, args, blk]) end end end end
Version data entries
21 entries across 21 versions & 1 rubygems