Class WDDX::Struct
In: lib/wddx/struct.rb
Parent: WddxData

Struct is a sorted Hash. Use with care and only if the sort order is important - use Hash instead!

Methods

<=>   []   []=   add   at   clear   delete   each   each_key   each_pair   each_value   empty?   grep   has_key?   include?   inspect   key?   length   member?   new   put   size  

Included Modules

Enumerable

Public Class methods

Public Instance methods

Element reference - Retrieves the value stored for key.

Element assignment - Associates the value given by value with the key given by key

add(key, value)

Alias for put

Returns the element at index. A negative index counts from the end of self. Returns nil if the index is out of range.

Removes all key/value pairs from WDDX::Struct

Removes the key and its associated value from the struct

Calls block once for each key in WDDX::Struct, passing the key and value as parameter.

Calls block for each key in WDDX::Struct, passing the key as the parameter.

each_pair()

Alias for each

Calls block for each key in WDDX::Struct, passing the value as the parameter.

Returns true if WDDX::Struct contains no key/value pairs

has_key?(arg)

Alias for key?

include?(arg)

Alias for key?

Returns true if the given key is present in WDDX::Struct

length()

Alias for size

member?(arg)

Alias for key?

Element assignment - Associates the value given by value with the key given by key

Returns the number of key/value pairs in WDDX::Struct

[Validate]