.yardoc/objects/root.dat in iqeo-conf-1.0.0 vs .yardoc/objects/root.dat in iqeo-conf-1.0.1

- old
+ new

@@ -50,29 +50,25 @@ param; F;GI".the value to set the attribute _items to.; F;I" value; F;H0;!@;%I"USets the attribute _items @param value the value to set the attribute _items to.; F;&0;'0;(@;<I"def _items=(value); F;>I"-def _items=(value) @_items = value end; F;1To;2;3F;4;;;;)I"#Iqeo::Configuration#initialize; F;5[[" default"nil[I" &block; F0;[[@i\;F;:initialize;;;[;IC;" ; F;!@;"0;#F;$[;[o;E -;FI" return; F;GI"$a new instance of Configuration; F;0;H[I"Configuration; F;!@;%I"; F;&0;'0;(@;<")def initialize default = nil, &block;=T;>"{def initialize default = nil, &block - # todo: default immediate child Configurations should have _parent updated - @_items = case - when default.kind_of?( HashWithIndifferentAccess ) then default - when default.kind_of?( Configuration ) then default._items - else HashWithIndifferentAccess.new - end +;FI" return; F;GI"$a new instance of Configuration; F;0;H[I"Configuration; F;!@;%I"; F;&0;'0;(@;<")def initialize default = nil, &block;=T;>"def initialize default = nil, &block + @_items = HashWithIndifferentAccess.new @_parent = nil + _merge! default if default.kind_of?( Configuration ) if block_given? - if block.arity > 0 # cannot set parent for yield blocks here as self is wrong !? - yield self + if block.arity > 0 # cannot set parent for yield block here as context is unknowable + yield self # parent is being set in new_defer_block_for_parent else if block.binding.eval('self').kind_of?( Configuration ) # for eval block if nested configuration @_parent = block.binding.eval('self') # set parent to make inherited values available end # during block execution instance_eval &block end end -end;1To;2;3F;4;;;;)I"'Iqeo::Configuration#method_missing; F;5[[" name0[I" *values; F0[I" &block; F0;[[@ip;F;:method_missing;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"-def method_missing name, *values, &block;=T;>"def method_missing name, *values, &block +end;1To;2;3F;4;;;;)I"'Iqeo::Configuration#method_missing; F;5[[" name0[I" *values; F0[I" &block; F0;[[@il;F;:method_missing;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"-def method_missing name, *values, &block;=T;>"def method_missing name, *values, &block return @_items.send( name, *values, &block ) if @_items.respond_to? name # @_items methods are highest priority name = name.to_s.chomp('=') if block_given? # block is a nested configuration @@ -85,72 +81,69 @@ return _get name if values.empty? # just get item return _set name, values if values.size > 1 # set item to multiple values return _set name, values.first # set item to single value end;1To;2;3F;4;;;B;)I"Iqeo::Configuration#_set; F;5[["key0[" -value0;[[@i};F;: _set;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _set key, value;=T;>"9def _set key, value - # todo: extend parenting for enumerable with configurations at arbitrary depth - case - when value.kind_of?( Configuration ) then value._parent = self - when value.kind_of?( Enumerable ) then value.each { |v| v._parent = self if v.kind_of? Configuration } - end +value0;[[@i~;F;: _set;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _set key, value;=T;>"mdef _set key, value + value._parent = self if value.kind_of?( Configuration ) @_items[key] = value -end;1To;2;3F;4;;;B;)I"Iqeo::Configuration#[]=; F;5[;[[@i;F;:[]=;;;[;IC;" ; F;!@;"0;#F;$[;[;%I" -; F;70;&0;'0;(@;<@;>"9def _set key, value - # todo: extend parenting for enumerable with configurations at arbitrary depth - case - when value.kind_of?( Configuration ) then value._parent = self - when value.kind_of?( Enumerable ) then value.each { |v| v._parent = self if v.kind_of? Configuration } - end +end;1To;2;3F;4;;;B;)I"Iqeo::Configuration#[]=; F;5[;[[@i};F;:[]=;;;[;IC;" ; F;!@;"0;#F;$[;[;%I" +; F;70;&0;'0;(@;<@;>"mdef _set key, value + value._parent = self if value.kind_of?( Configuration ) @_items[key] = value -end;1To;2;3F;4;;;B;)I"Iqeo::Configuration#_get; F;5[["key0;[[@i;T;: _get;;;[;IC;"Retrieves value for key, indifferent storage permits key to be a string or symbol. +end;1To;2;3F;4;;;B;)I"Iqeo::Configuration#_get; F;5[["key0;[[@i;T;: _get;;;[;IC;"Retrieves value for key, indifferent storage permits key to be a string or symbol. If configuration is nested, searches for key recursively up to root. Returns nil if key does not exist. ; F;$[;[;%I"Retrieves value for key, indifferent storage permits key to be a string or symbol. If configuration is nested, searches for key recursively up to root. -Returns nil if key does not exist.; F;!@;#F;7o;8;9F;:i;;i;&0;'0;(@;<"def _get key;=T;>"}def _get key +Returns nil if key does not exist.; F;!@;#F;7o;8;9F;:i;;i;&0;'0;(@;<"def _get key;=T;>"def _get key return @_items[key] unless @_items[key].nil? - return @_items[key] if _parent.nil? - _parent._get key -end;1To;2;3F;4;;;B;)I"Iqeo::Configuration#[]; F;5[;[[@i;F;:[];;;[;IC;"Retrieves value for key, indifferent storage permits key to be a string or symbol. + return @_items[key] if @_parent.nil? + @_parent._get key +end;1To;2;3F;4;;;B;)I"Iqeo::Configuration#[]; F;5[;[[@i;F;:[];;;[;IC;"Retrieves value for key, indifferent storage permits key to be a string or symbol. If configuration is nested, searches for key recursively up to root. Returns nil if key does not exist. ; F;!@;"0;#F;$[;[;%I"Retrieves value for key, indifferent storage permits key to be a string or symbol. If configuration is nested, searches for key recursively up to root. Returns nil if key does not exist. -; F;70;&0;'0;(@;<@;>"}def _get key +; F;70;&0;'0;(@;<@;>"def _get key return @_items[key] unless @_items[key].nil? - return @_items[key] if _parent.nil? - _parent._get key -end;1To;2;3F;4;;;;)I"Iqeo::Configuration#_read; F;5[[" string0;[[@i;F;: + return @_items[key] if @_parent.nil? + @_parent._get key +end;1To;2;3F;4;;;;)I"Iqeo::Configuration#_read; F;5[[" string0;[[@i;F;: _read;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _read string;=T;>"0def _read string instance_eval string -end;1To;2;3F;4;;;;)I"Iqeo::Configuration#_load; F;5[[" file0;[[@i;F;: +end;1To;2;3F;4;;;;)I"Iqeo::Configuration#_load; F;5[[" file0;[[@i;F;: _load;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _load file;=T;>"Udef _load file _read file.respond_to?(:read) ? file.read : File.read(file) end;1To;2;3F;4;;;;)I" Iqeo::Configuration#_merge!; F;5[[" -other0;[[@i;F;: _merge!;;;[;IC;" ; F;!@ -;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _merge! other;=T;>"def _merge! other - # todo: merges should update _parent of any immediate child Configurations - @_items.merge! other._items +other0;[[@i;F;: _merge!;;;[;IC;" ; F;!@ +;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _merge! other;=T;>".def _merge! other + @_items.merge!(other._items) do |key,this,other| + if this.kind_of?( Configuration ) && other.kind_of?( Configuration ) + this._merge! other + else + other + end + end + @_items.values.each { |value| value._parent = self if value.kind_of?( Configuration ) } self end;1To;2;3F;4;;;;)I"Iqeo::Configuration#_merge; F;5[[" -other0;[[@i;F;: _merge;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _merge other;=T;>"def _merge other - # todo: merges should update _parent of any immediate child Configurations +other0;[[@i;F;: _merge;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(@;<"def _merge other;=T;>"2def _merge other self.dup._merge! other end;1T; @; IC;[; @; IC;[; @;IC;{;IC;{;T;IC;{;CIC;{;?@Z: write@f;T;IIC;{;?@x;U@;T;T;T;{@;M@;O;[;[[@i7;T;:Configuration;;;;;[;IC;"BConfiguration class. A DSL representing configuration files. ; F;$[;[;%I"BConfiguration class. A DSL representing configuration files.; F;!@;#F;7o;8;9F;:i3;;i5;&0;'0;(@;)I"Iqeo::Configuration; F;*o;+ ;,0;-0;.0;;;(@;0@ -;1To:&YARD::CodeObjects::ConstantObject;[["&lib/iqeo/configuration/version.rbi;F;:CONFIGURATION_VERSION;;;;;[;IC;" ; F;!@9;"0;#F;$[;[;%I"; F;&0;'0;(@;)I" Iqeo::CONFIGURATION_VERSION; F;<"%CONFIGURATION_VERSION = "0.0.13";>"%CONFIGURATION_VERSION = "0.0.13": @value" "0.0.13";1T; @; IC;[; @; IC;[; @;IC;{;IC;{;T;IC;{;T;T;{;[;[[@i [@<i;T;: Iqeo;;;;;[;IC;"Iqeo namespace ; F;$[;[;%"Iqeo namespace;!@;#F;7o;8;9F;:i +;1To:&YARD::CodeObjects::ConstantObject;[["&lib/iqeo/configuration/version.rbi;F;:CONFIGURATION_VERSION;;;;;[;IC;" ; F;!@9;"0;#F;$[;[;%I"; F;&0;'0;(@;)I" Iqeo::CONFIGURATION_VERSION; F;<"$CONFIGURATION_VERSION = "1.0.1";>"$CONFIGURATION_VERSION = "1.0.1": @value" "1.0.1";1T; @; IC;[; @; IC;[; @;IC;{;IC;{;T;IC;{;T;T;{;[;[[@i [@<i;T;: Iqeo;;;;;[;IC;"Iqeo namespace ; F;$[;[;%"Iqeo namespace;!@;#F;7o;8;9F;:i ;;i ;&0;'0;(@;)I" Iqeo; F; @; IC;[; @; IC;[; @;IC;{;IC;{;T;IC;{;T;T;{;[;[;F;;;;;;;[;IC;" ; F;!@;"0;#F;$[;[;%I"; F;&0;'0;(0;)I"; F;Z@:Iqeo::BlankSlate@ :Iqeo::Configuration@: Iqeo::Configuration.version@:Iqeo::Configuration.read@,:Iqeo::Configuration.load@;:3Iqeo::Configuration.new_defer_block_for_parent@J: Iqeo::Configuration#_parent@Z:!Iqeo::Configuration#_parent=@f:Iqeo::Configuration#_items@x: Iqeo::Configuration#_items=@:#Iqeo::Configuration#initialize@:'Iqeo::Configuration#method_missing@:Iqeo::Configuration#_set@:Iqeo::Configuration#[]=@:Iqeo::Configuration#_get@:Iqeo::Configuration#[]@:Iqeo::Configuration#_read@:Iqeo::Configuration#_load@: Iqeo::Configuration#_merge!@ :Iqeo::Configuration#_merge@: Iqeo::CONFIGURATION_VERSION@9 \ No newline at end of file