Skip to content

Commit

Permalink
copy edit and remove nodoc on instance_values method [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydev committed May 17, 2012
1 parent b71a900 commit a3dd7a4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Object
# Returns a hash that maps instance variable names without "@" to their
# corresponding values. Keys are strings.
# Returns a hash with string keys that maps instance variable names without "@" to their
# corresponding values.
#
# class C
# def initialize(x, y)
Expand All @@ -9,11 +9,11 @@ class Object
# end
#
# C.new(0, 1).instance_values # => {"x" => 0, "y" => 1}
def instance_values #:nodoc:
def instance_values
Hash[instance_variables.map { |name| [name[1..-1], instance_variable_get(name)] }]
end

# Returns an array of instance variable names including "@". They are strings.
# Returns an array of instance variable names including "@".
#
# class C
# def initialize(x, y)
Expand Down

0 comments on commit a3dd7a4

Please sign in to comment.