Skip to content

Commit

Permalink
Ruby 1.8 support had gone
Browse files Browse the repository at this point in the history
instance_variable_names remains for internal use, but it's not that useful for the users anymore
  • Loading branch information
amatsuda committed Jan 4, 2013
1 parent ffaad63 commit 2573484
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions guides/source/active_support_core_extensions.md
Expand Up @@ -422,24 +422,6 @@ NOTE: Defined in `active_support/core_ext/object/with_options.rb`.


Active Support provides several methods to ease access to instance variables. Active Support provides several methods to ease access to instance variables.


#### `instance_variable_names`

Ruby 1.8 and 1.9 have a method called `instance_variables` that returns the names of the defined instance variables. But they behave differently, in 1.8 it returns strings whereas in 1.9 it returns symbols. Active Support defines `instance_variable_names` as a portable way to obtain them as strings:

```ruby
class C
def initialize(x, y)
@x, @y = x, y
end
end

C.new(0, 1).instance_variable_names # => ["@y", "@x"]
```

WARNING: The order in which the names are returned is unspecified, and it indeed depends on the version of the interpreter.

NOTE: Defined in `active_support/core_ext/object/instance_variables.rb`.

#### `instance_values` #### `instance_values`


The method `instance_values` returns a hash that maps instance variable names without "@" to their The method `instance_values` returns a hash that maps instance variable names without "@" to their
Expand Down

0 comments on commit 2573484

Please sign in to comment.