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
to_a

struct.to_a â array Instance Public methods Returns the values for this

2015-05-16 06:01:50
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
to_json

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

2015-05-16 06:07:40
[]=

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

2015-05-16 05:26:23
[]

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

2015-05-16 05:18:49
as_json

as_json(*) Instance Public methods Returns a hash, that will be turned into

2015-05-16 05:33:05