Parent

Methods

Struct

Public Instance Methods

attributes() click to toggle source

Get a hash with names and values of all instance variables.

  class Foo < Struct.new(:name, :age, :gender); end
  f = Foo.new("Jill", 50, :female)
  f.attributes   #=> {:name => "Jill", :age => 50, :gender => :female}

@return [Hash] Hash of instance variables in receiver, keyed by ivar name

@api public

    # File lib/extlib/struct.rb, line 12
12:   def attributes
13:     h = {}
14:     each_pair { |k,v| h[k] = v }
15:     h
16:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.