Class: Iqeo::ConfigurationDelegator
- Inherits:
-
Object
- Object
- Iqeo::ConfigurationDelegator
- Defined in:
- lib/iqeo/configuration.rb
Overview
todo: inherit from < Blankslate ?
Instance Attribute Summary collapse
-
#_confs ⇒ Object
readonly
Returns the value of attribute _confs.
Instance Method Summary collapse
- #* ⇒ Object
-
#empty? ⇒ Boolean
alias [] method_missing # so we don’t have to deal with [ and ‘key’ separately ( see alias [] _get in Configuration ).
-
#initialize(confs) ⇒ ConfigurationDelegator
constructor
protected :_confs.
- #method_missing(name, *values, &block) ⇒ Object
Constructor Details
#initialize(confs) ⇒ ConfigurationDelegator
protected :_confs
197 198 199 |
# File 'lib/iqeo/configuration.rb', line 197 def initialize confs @_confs = confs end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *values, &block) ⇒ Object
201 202 203 |
# File 'lib/iqeo/configuration.rb', line 201 def method_missing name, *values, &block return @_confs.send( name, *values, &block ) if @_confs.respond_to? name # @_confs methods are highest priority end |
Instance Attribute Details
#_confs ⇒ Object (readonly)
Returns the value of attribute _confs.
193 194 195 |
# File 'lib/iqeo/configuration.rb', line 193 def _confs @_confs end |
Instance Method Details
#* ⇒ Object
210 211 212 |
# File 'lib/iqeo/configuration.rb', line 210 def * ConfigurationDelegator.new( @_confs.inject([]) { |array,conf| array + conf._configurations } ) end |
#empty? ⇒ Boolean
alias [] method_missing # so we don’t have to deal with [ and ‘key’ separately ( see alias [] _get in Configuration )
206 207 208 |
# File 'lib/iqeo/configuration.rb', line 206 def empty? @_confs.empty? end |