Ruby Struct Functions
EditRocket provides the following information on Struct functions in the Ruby source code builder.
each - Calls block once for each instance variable, passing the value as a parameter.
each_pair - Calls block once for each instance variable, passing the name (as a symbol) and the value as parameters.
eql?(p1) - "code-seq:"
hash - Return a hash value based on this struct's contents.
inspect - Describe the contents of this struct in a string.
length - Returns the number of instance variables.
members - Returns an array of strings representing the names of the instance variables.
new(...) -
pretty_print(q) -
pretty_print_cycle(q) -
select - Invokes the block passing in successive elements from struct, returning an array containing those elements for which the block returns a true value (equivalent to Enumerable#select).
size - Returns the number of instance variables.
to_a - Returns the values for this instance as an array.
to_s - Describe the contents of this struct in a string.
to_yaml( opts = {} ) -
values - Returns the values for this instance as an array.
values_at(selector,... ) - Returns an array containing the elements in self corresponding to the given selector(s). The selectors may be either integer indices or ranges. See also </code>.select<code>.
yaml_new( klass, tag, val ) -
yaml_tag_class_name() -
yaml_tag_read_class( name ) -