ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- each_pair-i.ri000064400000001255152361424550007253 0ustar00U:RDoc::AnyMethod[iI"each_pair:EFI"OpenStruct#each_pair;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"MYields all attributes (as a symbol) along with the corresponding values ;TI"5or returns an enumerator if not block is given. ;TI" Example:;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"require 'ostruct' ;TI"Pdata = OpenStruct.new("country" => "Australia", :population => 20_000_000) ;TI"Qdata.each_pair.to_a # => [[:country, "Australia"], [:population, 20000000]];T: @format0: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below00I"p;T[I"();T@FI"OpenStruct;TcRDoc::NormalClass00dig-i.ri000064400000001614152361424550006102 0ustar00U:RDoc::AnyMethod[iI"dig:ETI"OpenStruct#dig;TF: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [ I"4Finds and returns the object in nested objects ;TI"4that is specified by +name+ and +identifiers+. ;TI"=The nested objects may be instances of various classes. ;TI"2See {Dig Methods}[rdoc-ref:dig_methods.rdoc].;To:RDoc::Markup::BlankLineo; ; [I"Examples:;To:RDoc::Markup::Verbatim; [ I"require "ostruct" ;TI"Faddress = OpenStruct.new("city" => "Anytown NC", "zip" => 12345) ;TI"Lperson = OpenStruct.new("name" => "John Smith", "address" => address) ;TI",person.dig(:address, "zip") # => 12345 ;TI"2person.dig(:business_address, "zip") # => nil;T: @format0: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below0I"/ostruct.dig(name, *identifiers) -> object ;T0[I"(name, *names);T@FI"OpenStruct;TcRDoc::NormalClass00inspect-i.ri000064400000000565152361424550007010 0ustar00U:RDoc::AnyMethod[iI" inspect:EFI"OpenStruct#inspect;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"KReturns a string containing a detailed summary of the keys and values.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[[I" to_s;To;; [; @; 0I"();T@FI"OpenStruct;TcRDoc::NormalClass00json_create-c.ri000064400000000654152361424550007630 0ustar00U:RDoc::AnyMethod[iI"json_create:EFI"OpenStruct::json_create;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"LDeserializes JSON string by constructing new Struct object with values ;TI"/v serialized by to_json.;T: @fileI"%ext/json/lib/json/add/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (object);T@FI"OpenStruct;TcRDoc::NormalClass00eql%3f-i.ri000064400000000671152361424550006420 0ustar00U:RDoc::AnyMethod[iI" eql?:EFI"OpenStruct#eql?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NCompares this object and +other+ for equality. An OpenStruct is eql? to ;TI"P+other+ when +other+ is an OpenStruct and the two objects' Hash tables are ;TI" eql?.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (other);T@FI"OpenStruct;TcRDoc::NormalClass00new-c.ri000064400000001466152361424550006127 0ustar00U:RDoc::AnyMethod[iI"new:ETI"OpenStruct::new;TT: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"LCreates a new OpenStruct object. By default, the resulting OpenStruct ;TI"$object will have no attributes.;To:RDoc::Markup::BlankLineo; ; [I"HThe optional +hash+, if given, will generate attributes and values ;TI"1(can be a Hash, an OpenStruct or a Struct). ;TI"For example:;T@o:RDoc::Markup::Verbatim; [ I"require 'ostruct' ;TI"Dhash = { "country" => "Australia", :population => 20_000_000 } ;TI"!data = OpenStruct.new(hash) ;TI" ;TI"Lp data # -> ;T: @format0: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"(hash=nil);T@FI"OpenStruct;TcRDoc::NormalClass00freeze-i.ri000064400000000354152361424550006617 0ustar00U:RDoc::AnyMethod[iI" freeze:ETI"OpenStruct#freeze;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ TI"OpenStruct;TcRDoc::NormalClass00set_ostruct_member_value%21-i.ri000064400000000453152361424550012650 0ustar00U:RDoc::AnyMethod[iI"set_ostruct_member_value!:ETI")OpenStruct#set_ostruct_member_value!;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"(name, value);T@ FI"OpenStruct;TcRDoc::NormalClass0[@FI"[]=;T%5b%5d-i.ri000064400000000742152361424550006211 0ustar00U:RDoc::AnyMethod[iI"[]:EFI"OpenStruct#[];TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"#Returns the value of a member.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"Bperson = OpenStruct.new('name' => 'John Smith', 'age' => 70) ;TI".person[:age] # => 70, same as ostruct.age;T: @format0: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (name);T@FI"OpenStruct;TcRDoc::NormalClass00cdesc-OpenStruct.ri000064400000006655152361424550010310 0ustar00U:RDoc::NormalClass[iI"OpenStruct:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"-OpenStruct serialization/deserialization;T: @fileI"%ext/json/lib/json/add/ostruct.rb;T:0@omit_headings_from_table_of_contents_below0o;;[o; ;[ 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"person.pension = 300 ;TI" ;TI",puts person.name # -> "John Smith" ;TI""puts person.age # -> 70 ;TI"#puts person.address # -> nil ;T: @format0o; ;[I"QAn OpenStruct employs a Hash internally to store the methods and values and ;TI"&can even be initialized with one:;T@o;;[I"Taustralia = OpenStruct.new(:country => "Australia", :population => 20_000_000) ;TI"Mp australia # -> ;T;0o; ;[ I"THash keys with spaces or characters that would normally not be able to use for ;TI"Hmethod calls (e.g. ()[]*) will not be immediately available on the ;TI"TOpenStruct object as a method for retrieval or assignment, but can be still be ;TI",reached through the Object#send method.;T@o;;[ I"?measurements = OpenStruct.new("length (in inches)" => 24) ;TI"6measurements.send("length (in inches)") # -> 24 ;TI" ;TI"3data_point = OpenStruct.new(:queued? => true) ;TI"8data_point.queued? # -> true ;TI"'data_point.send("queued?=",false) ;TI"9data_point.queued? # -> false ;T;0o; ;[I"ORemoving the presence of a method requires the execution the delete_field ;TI"Nmethod as setting the property value to +nil+ will not remove the method.;T@o;;[ I"Jfirst_pet = OpenStruct.new(:name => 'Rowdy', :owner => 'John Smith') ;TI"first_pet.owner = nil ;TI"3second_pet = OpenStruct.new(:name => 'Rowdy') ;TI" ;TI"*first_pet == second_pet # -> false ;TI" ;TI"$first_pet.delete_field(:owner) ;TI")first_pet == second_pet # -> true ;T;0S; ;i;I"Implementation:;T@o; ;[I"RAn OpenStruct utilizes Ruby's method lookup structure to find and define the ;TI"Onecessary methods for properties. This is accomplished through the method ;TI"&method_missing and define_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.;T; I"lib/ostruct.rb;T; 0; 0; 0[[[[[I" class;T[[: public[[I"json_create;FI"%ext/json/lib/json/add/ostruct.rb;T[I"new;TI"lib/ostruct.rb;T[:protected[[: private[[I" instance;T[[;[[I"==;T@h[I"[];F@h[I"[]=;F@h[I" as_json;F@e[I"delete_field;F@h[I"each_pair;F@h[I" eql?;F@h[I" hash;F@h[I"initialize_copy;F@h[I" inspect;F@h[I"marshal_dump;F@h[I"marshal_load;F@h[I" to_h;F@h[I" to_json;F@e[I" to_s;T@h[;[[I"modifiable;F@h[I"new_ostruct_member;F@h[;[[[U:RDoc::Context::Section[i0o;;[; 0; 0[@@Y@YcRDoc::TopLevelas_json-i.ri000064400000000576152361424550007001 0ustar00U:RDoc::AnyMethod[iI" as_json:EFI"OpenStruct#as_json;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"OReturns a hash, that will be turned into a JSON object and represent this ;TI" object.;T: @fileI"%ext/json/lib/json/add/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"(*);T@FI"OpenStruct;TcRDoc::NormalClass00to_json-i.ri000064400000000606152361424550007012 0ustar00U:RDoc::AnyMethod[iI" to_json:EFI"OpenStruct#to_json;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NStores class name (OpenStruct) with this struct's values v as a ;TI"JSON string.;T: @fileI"%ext/json/lib/json/add/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (*args);T@FI"OpenStruct;TcRDoc::NormalClass00to_s-i.ri000064400000000371152361424550006302 0ustar00U:RDoc::AnyMethod[iI" to_s:ETI"OpenStruct#to_s;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"OpenStruct;TcRDoc::NormalClass0[@FI" inspect;F%5b%5d%3d-i.ri000064400000001016152361424550006500 0ustar00U:RDoc::AnyMethod[iI"[]=:EFI"OpenStruct#[]=;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" Sets the value of a member.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"Bperson = OpenStruct.new('name' => 'John Smith', 'age' => 70) ;TI";person[:age] = 42 # => equivalent to ostruct.age = 42 ;TI"person.age # => 42;T: @format0: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"(name, value);T@FI"OpenStruct;TcRDoc::NormalClass00delete_field-i.ri000064400000001162152361424550007742 0ustar00U:RDoc::AnyMethod[iI"delete_field:EFI"OpenStruct#delete_field;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NRemove the named field from the object. Returns the value that the field ;TI"!contained if it was defined.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"require 'ostruct' ;TI" ;TI"Bperson = OpenStruct.new('name' => 'John Smith', 'age' => 70) ;TI" ;TI"3person.delete_field('name') # => 'John Smith';T: @format0: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (name);T@FI"OpenStruct;TcRDoc::NormalClass00to_h-i.ri000064400000001220152361424550006261 0ustar00U:RDoc::AnyMethod[iI" to_h:EFI"OpenStruct#to_h;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I">Converts the OpenStruct to a hash with keys representing ;TI"@each attribute (as symbols) and their corresponding values ;TI" Example:;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [I"require 'ostruct' ;TI"Pdata = OpenStruct.new("country" => "Australia", :population => 20_000_000) ;TI"Idata.to_h # => {:country => "Australia", :population => 20000000 };T: @format0: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"OpenStruct;TcRDoc::NormalClass00%3d%3d-i.ri000064400000000667152361424550006215 0ustar00U:RDoc::AnyMethod[iI"==:ETI"OpenStruct#==;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"OCompares this object and +other+ for equality. An OpenStruct is equal to ;TI"P+other+ when +other+ is an OpenStruct and the two objects' Hash tables are ;TI" equal.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (other);T@FI"OpenStruct;TcRDoc::NormalClass00new_ostruct_member-i.ri000064400000000763152374052230011242 0ustar00U:RDoc::AnyMethod[iI"new_ostruct_member:EFI""OpenStruct#new_ostruct_member;TF:protectedo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"2Used internally to defined properties on the ;TI"DOpenStruct. It does this by using the metaprogramming function ;TI"Ndefine_singleton_method for both the getter method and the setter method.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (name);T@FI"OpenStruct;TcRDoc::NormalClass00modifiable-i.ri000064400000000646152374052230007432 0ustar00U:RDoc::AnyMethod[iI"modifiable:EFI"OpenStruct#modifiable;TF:protectedo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I">Used internally to check if the OpenStruct is able to be ;TI"Omodified before granting access to the internal Hash table to be modified.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"OpenStruct;TcRDoc::NormalClass00marshal_dump-i.ri000064400000000531152374052230010004 0ustar00U:RDoc::AnyMethod[iI"marshal_dump:EFI"OpenStruct#marshal_dump;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AProvides marshalling support for use by the Marshal library.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"OpenStruct;TcRDoc::NormalClass00initialize_copy-i.ri000064400000000516152374052230010526 0ustar00U:RDoc::AnyMethod[iI"initialize_copy:EFI"OpenStruct#initialize_copy;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I",Duplicate an OpenStruct object members.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I" (orig);T@TI"OpenStruct;TcRDoc::NormalClass00marshal_load-i.ri000064400000000532152374052230007757 0ustar00U:RDoc::AnyMethod[iI"marshal_load:EFI"OpenStruct#marshal_load;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"AProvides marshalling support for use by the Marshal library.;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"(x);T@FI"OpenStruct;TcRDoc::NormalClass00hash-i.ri000064400000000625152374052230006257 0ustar00U:RDoc::AnyMethod[iI" hash:EFI"OpenStruct#hash;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I".Compute a hash-code for this OpenStruct. ;TI"CTwo hashes with the same content will have the same hash code ;TI"(and will be eql?).;T: @fileI"lib/ostruct.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"OpenStruct;TcRDoc::NormalClass00