Type:
Class

Struct serialization/deserialization

A Struct is a convenient way to bundle a number of attributes together, using accessor methods, without having to write an explicit class.

The Struct class is a generator of specific classes, each one of which is defined to hold a set of variables and their accessors. In these examples, we'll call the generated class “CustomerClass,'' and we'll show an example instance of that class as “CustomerInst.''

In the descriptions that follow, the parameter symbol refers to a symbol, which is either a quoted string or a Symbol (such as :name).

==

struct == other_struct â true or false Instance Public methods EqualityâReturns

2015-05-16 05:13:12
to_h

struct.to_h â hash Instance Public methods Returns the values for this

2015-05-16 06:04:54
pretty_print

pretty_print(q) Instance Public methods

2015-05-16 05:50:07
members

struct.members â array Instance Public methods Returns an array of symbols

2015-05-16 05:46:29
to_json

to_json(*args) Instance Public methods Stores class name (Struct) with

2015-05-16 06:07:40
inspect

struct.to_s â stringstruct.inspect â string Instance Public methods Describe

2015-05-16 05:42:07
to_s

to_s() Instance Public methods Alias for:

2015-05-16 06:09:56
[]

struct[symbol] â anObjectstruct[fixnum] â anObject Instance Public methods

2015-05-16 05:18:49
each_pair

struct.each_pair {|sym, obj| block } â structstruct.each_pair â an_enumerator

2015-05-16 05:35:04
[]=

struct[symbol] = obj â objstruct[fixnum] = obj â obj Instance Public methods

2015-05-16 05:26:23