Sha256: b50edfb61719067527ea0484b94b2bbc93dc66b3bb62945492416f2cb52fd6c7
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
module Coercible class Coercer module Configurable # Add configuration-specific option keys to the descendant # # @return [self] # # @api private def self.extended(coercer) coercer.accept_options :config_keys super end # Build configuration object for the coercer class # # @example # # coercer_class = Class.new(Coercer::Object) do # extend Configurable # # config_keys [ :foo, :bar ] # end # # coercer_class.config do |config| # config.foo = '1' # config.bar = '2' # end # # @yieldparam [Configuration] # # @return [Configuration] # # @api public def config(&block) configuration = configuration_class.build(config_keys) yield configuration configuration end # Return configuration name in the global config # # @return [Symbol] # # @api private def config_name name.downcase.split('::').last.to_sym end # @api private def configuration_class Configuration end end # module Configurable end # class Coercer end # module Coercible
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
coercible-0.2.0 | lib/coercible/coercer/configurable.rb |
coercible-0.1.0 | lib/coercible/coercer/configurable.rb |