ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ???????????????????????????????????? ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ???????????????????????????????????? U:RDoc::NormalClass[iI" Data:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"E\Class \Data provides a convenient way to define simple classes ;TI"for value-alike objects.;To:RDoc::Markup::BlankLineo; ;[I"#The simplest example of usage:;T@o:RDoc::Markup::Verbatim;[I"+Measure = Data.define(:amount, :unit) ;TI" ;TI"4# Positional arguments constructor is provided ;TI"'distance = Measure.new(100, 'km') ;TI"/#=> # ;TI" ;TI"1# Keyword arguments constructor is provided ;TI"2weight = Measure.new(amount: 50, unit: 'kg') ;TI".#=> # ;TI" ;TI"0# Alternative form to construct an object: ;TI" speed = Measure[10, 'mPh'] ;TI"/#=> # ;TI" ;TI"*# Works with keyword arguments, too: ;TI".area = Measure[amount: 1.5, unit: 'm^2'] ;TI"0#=> # ;TI" ;TI"(# Argument accessors are provided: ;TI"distance.amount #=> 100 ;TI"distance.unit #=> "km" ;T: @format0o; ;[I"AConstructed object also has a reasonable definitions of #== ;TI"Koperator, #to_h hash conversion, and #deconstruct / #deconstruct_keys ;TI"$to be used in pattern matching.;T@o; ;[I"C::define method accepts an optional block and evaluates it in ;TI"Cthe context of the newly defined class. That allows to define ;TI"additional methods:;T@o; ;[I".Measure = Data.define(:amount, :unit) do ;TI" def <=>(other) ;TI"E return unless other.is_a?(self.class) && other.unit == unit ;TI"! amount <=> other.amount ;TI" end ;TI" ;TI" include Comparable ;TI" end ;TI" ;TI"0Measure[3, 'm'] < Measure[5, 'm'] #=> true ;TI"(Measure[3, 'm'] < Measure[5, 'kg'] ;TI"A# comparison of Measure with Measure failed (ArgumentError) ;T; 0o; ;[ I"BData provides no member writers, or enumerators: it is meant ;TI"@to be a storage for immutable atomic values. But note that ;TI"Lif some of data members is of a mutable class, Data does no additional ;TI"immutability enforcement:;T@o; ;[I"+Event = Data.define(:time, :weekdays) ;TI"1event = Event.new('18:00', %w[Tue Wed Fri]) ;TI"D#=> # ;TI" ;TI"C# There is no #time= or #weekdays= accessors, but changes are ;TI"# still possible: ;TI"event.weekdays << 'Sat' ;TI" event ;TI"K#=> # ;T; 0o; ;[I"?See also Struct, which is a similar concept, but has more ;TI"Dcontainer-alike API, allowing to change contents of the object ;TI"and enumerate it.;T: @fileI" struct.c;T:0@omit_headings_from_table_of_contents_below0; 0;0[[[[[I" class;T[[: public[[I" define;TI" struct.c;T[I" members;T@f[I"new;T@f[:protected[[: private[[I" instance;T[[;[[I"==;T@f[I"deconstruct;T@f[I"deconstruct_keys;T@f[I" eql?;T@f[I" hash;T@f[I" inspect;T@f[I" members;T@f[I" to_h;T@f[I" to_s;T@f[I" with;T@f[;[[;[[[U:RDoc::Context::Section[i0o;;[; 0;0[I"lib/pp.rb;T@Z@ZcRDoc::TopLevel