Skip to content

Instantly share code, notes, and snippets.

@kfatehi
Created August 1, 2012 00:02
Show Gist options
  • Save kfatehi/3221876 to your computer and use it in GitHub Desktop.
Save kfatehi/3221876 to your computer and use it in GitHub Desktop.
➜ ~ irb
1.9.3p194 :001 > @args = {"foo"=>2}
=> {"foo"=>2}
1.9.3p194 :002 > :@args
=> :@args
1.9.3p194 :003 > instance_variable_defined?
instance_variable_defined?
1.9.3p194 :003 > instance_variable_defined? :@args
=> true
1.9.3p194 :004 > instance_variable_defined? :@argss
=> false
1.9.3p194 :005 > instance_variable_defined? :args
NameError: `args' is not allowed as an instance variable name
from (irb):5:in `instance_variable_defined?'
from (irb):5
from /Users/keyvan/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
1.9.3p194 :006 > instance_variable_defined? :@args
=> true
1.9.3p194 :007 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment