JezK
Edit File: cdesc-PropertyHash.ri
U:RDoc::NormalClass[iI"PropertyHash:EFI"Hashery::PropertyHash;FI"Hashery::CRUDHash;Fo:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"PA PropertyHash is the same as a regular Hash except it strictly limits the ;TI"allowed keys.;To:RDoc::Markup::BlankLine o; ;[I""There are two ways to use it.;T@o; ;[I"1) As an object in itself.;T@o:RDoc::Markup::Verbatim;[ I"(h = PropertyHash.new(:a=>1, :b=>2) ;TI"h[:a] #=> 1 ;TI"h[:a] = 3 ;TI"h[:a] #=> 3 ;T:@format0o; ;[I"LBut if we try to set key that was not fixed, then we will get an error.;T@o;;[I"$h[:x] = 5 #=> ArgumentError ;T;0o; ;[I"2) As a superclass.;T@o;;[I")class MyPropertyHash < PropertyHash ;TI"" property :a, :default => 1 ;TI"" property :b, :default => 2 ;TI" end ;TI" ;TI"h = MyPropertyHash.new ;TI"h[:a] #=> 1 ;TI"h[:a] = 3 ;TI"h[:a] #=> 3 ;T;0o; ;[I"OAgain, if we try to set key that was not fixed, then we will get an error.;T@o;;[I"#h[:x] = 5 #=> ArgumentError;T;0: @fileI"!lib/hashery/property_hash.rb;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ [ [[I" class;T[[:public[[I"new;TI"!lib/hashery/property_hash.rb;T[I"properties;F@E[I" property;F@E[:protected[ [:private[ [I" instance;T[[;[[I" property;F@E[I" store;F@E[I"store!;T@E[;[ [;[[I"assert_key!;F@E[ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[@9I"Hashery;FcRDoc::NormalModule