Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

copy edit and remove nodoc on instance_values method [ci skip]

  • Loading branch information...
commit a3dd7a4f735374928e28709b2a09dcabe0d9df0c 1 parent b71a900
@vijaydev vijaydev authored
View
8 activesupport/lib/active_support/core_ext/object/instance_variables.rb
@@ -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)
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.