Skip to content

Instantly share code, notes, and snippets.

@bewatts
Created July 8, 2015 17:27
Show Gist options
  • Save bewatts/980a2cb0113f4827e6dd to your computer and use it in GitHub Desktop.
Save bewatts/980a2cb0113f4827e6dd to your computer and use it in GitHub Desktop.
Instance Variable Example
class Example
def initialize( a, b )
@a = a
@b = b
end
def a
@a
end
def b
@b
end
def render
info_to_render(a, b)
end
def info_to_render(first, second)
"#{second} - #{first}"
end
end
Example.new(1, 2).render
Example.new(3, 4).render
puts Example.new(5,6).a
puts Example.new(6,7).b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment