ÿØÿà 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"OpenStruct:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[: @fileI"%ext/json/lib/json/add/ostruct.rb;T:0@omit_headings_from_table_of_contents_below0o;;[)o:RDoc::Markup::Paragraph;[ I"KAn OpenStruct is a data structure, similar to a Hash, that allows the ;TI"Pdefinition of arbitrary attributes with their accompanying values. This is ;TI"Qaccomplished by using Ruby's metaprogramming to define methods on the class ;TI" itself.;To:RDoc::Markup::BlankLineS:RDoc::Markup::Heading: leveli: textI" Examples;T@o:RDoc::Markup::Verbatim;[I"require "ostruct" ;TI" ;TI"person = OpenStruct.new ;TI" person.name = "John Smith" ;TI"person.age = 70 ;TI" ;TI"(person.name # => "John Smith" ;TI"person.age # => 70 ;TI"person.address # => nil ;T: @format0o; ;[I"PAn OpenStruct employs a Hash internally to store the attributes and values ;TI"*and can even be initialized with one:;T@o;;[I"Qaustralia = OpenStruct.new(:country => "Australia", :capital => "Canberra") ;TI"B # => # ;T;0o; ;[ I"MHash keys with spaces or characters that could normally not be used for ;TI"Nmethod calls (e.g. ()[]*) will not be immediately available ;TI"Oon the OpenStruct object as a method for retrieval or assignment, but can ;TI"Astill be reached through the Object#send method or using [].;T@o;;[ I"?measurements = OpenStruct.new("length (in inches)" => 24) ;TI"7measurements[:"length (in inches)"] # => 24 ;TI"7measurements.send("length (in inches)") # => 24 ;TI" ;TI"0message = OpenStruct.new(:queued? => true) ;TI"9message.queued? # => true ;TI"%message.send("queued?=", false) ;TI":message.queued? # => false ;T;0o; ;[I"IRemoving the presence of an attribute requires the execution of the ;TI"Idelete_field method as setting the property value to +nil+ will not ;TI"remove the attribute.;T@o;;[I"Kfirst_pet = OpenStruct.new(:name => "Rowdy", :owner => "John Smith") ;TI"3second_pet = OpenStruct.new(:name => "Rowdy") ;TI" ;TI"first_pet.owner = nil ;TI"Jfirst_pet # => # ;TI"*first_pet == second_pet # => false ;TI" ;TI"$first_pet.delete_field(:owner) ;TI"?first_pet # => # ;TI")first_pet == second_pet # => true ;T;0o; ;[I"YRactor compatibility: A frozen OpenStruct with shareable values is itself shareable.;T@S; ;i;I" Caveats;T@o; ;[I"RAn OpenStruct utilizes Ruby's method lookup structure to find and define the ;TI"Pnecessary methods for properties. This is accomplished through the methods ;TI"0method_missing and define_singleton_method.;T@o; ;[ I"SThis should be a consideration if there is a concern about the performance of ;TI"Qthe objects that are created, as there is much more overhead in the setting ;TI"?of these properties compared to using a Hash or a Struct. ;TI"JCreating an open struct from a small Hash and accessing a few of the ;TI"Fentries can be 200 times slower than accessing the hash directly.;T@o; ;[I"VThis is a potential security issue; building OpenStruct from untrusted user data ;TI"W(e.g. JSON web request) may be susceptible to a "symbol denial of service" attack ;TI"Tsince the keys create methods and names of methods are never garbage collected.;T@o; ;[I"LThis may also be the source of incompatibilities between Ruby versions:;T@o;;[I"o = OpenStruct.new ;TI"?o.then # => nil in Ruby < 2.6, enumerator for Ruby >= 2.6 ;T;0o; ;[I"PBuiltin methods may be overwritten this way, which may be a source of bugs ;TI"or security issues:;T@o;;[ I"o = OpenStruct.new ;TI"Jo.methods # => [:to_h, :marshal_load, :marshal_dump, :each_pair, ... ;TI"o.methods = [:foo, :bar] ;TI"!o.methods # => [:foo, :bar] ;T;0o; ;[I"gTo help remedy clashes, OpenStruct uses only protected/private methods ending with ! ;TI"Oand defines aliases for builtin public methods by adding a !:;T@o;;[I"9o = OpenStruct.new(make: 'Bentley', class: :luxury) ;TI"o.class # => :luxury ;TI"o.class! # => OpenStruct ;T;0o; ;[I"VIt is recommended (but not enforced) to not use fields ending in !; ;TI"\Note that a subclass' methods may not be overwritten, nor can OpenStruct's own methods ;TI" ending with !.;T@o; ;[I"AFor all these reasons, consider not using OpenStruct at all.;T; I"lib/ostruct.rb;T; 0; 0; 0[[U:RDoc::Constant[iI" VERSION;TI"OpenStruct::VERSION;T: public0o;;[; @; 0@@cRDoc::NormalClass0U;[iI"HAS_PERFORMANCE_WARNINGS;TI")OpenStruct::HAS_PERFORMANCE_WARNINGS;T: private0o;;[; @; 0@@@0[[[I" class;T[[;[[I"json_create;TI"%ext/json/lib/json/add/ostruct.rb;T[I"new;TI"lib/ostruct.rb;T[:protected[[;[[I" instance;T[[;[[I"==;T@[I"[];T@[I"[]=;T@[I" as_json;T@[I"delete_field;T@[I"dig;T@[I"each_pair;T@[I" eql?;T@[I" freeze;T@[I" inspect;T@[I" to_h;T@[I" to_json;T@[I" to_s;T@[;[[;[[I"set_ostruct_member_value!;T@[[U:RDoc::Context::Section[i0o;;[; 0; 0[@ @@cRDoc::TopLevel