Skip to content

Instantly share code, notes, and snippets.

@waseem
Forked from anonymous/example.rb
Last active August 29, 2015 14:07
Show Gist options
  • Save waseem/14276e9b2f9cac69375c to your computer and use it in GitHub Desktop.
Save waseem/14276e9b2f9cac69375c to your computer and use it in GitHub Desktop.
class someController < ApplicationController
def a
set_instance_variable
#How would i access @instance_variable in this method.
#I could make it a class variable right?
@instance_variable == 'whatever' #=> true
end
def b
set_instance_variable
@instance_variable == 'whatever' #=> true
end
private
def set_instance_variable
@instance_variable = 'whatever'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment