Created
July 8, 2015 17:27
-
-
Save bewatts/980a2cb0113f4827e6dd to your computer and use it in GitHub Desktop.
Instance Variable Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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