Last active
December 1, 2016 18:25
-
-
Save benjaminoakes/0653983106809c6b9a334452362a9de7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MyClass | |
def foo | |
@foo | |
end | |
def initialize(foo) | |
@foo = foo | |
end | |
def bar | |
'bar' | |
end | |
def baz | |
'baz' | |
end | |
def thud | |
'thud' | |
end | |
def garply | |
'garply' | |
end | |
def full_name | |
# str = "#{foo}" | |
str = foo.to_s | |
str << " #{bar}" if baz.nil? || (!baz.nil? && baz.include?('blarp')) | |
str << " #{thud}" | |
str << " - #{garply}" unless garply.nil? | |
str | |
end | |
end | |
my_class = MyClass.new('foo') | |
puts my_class.full_name | |
puts my_class.full_name | |
puts my_class.full_name | |
puts my_class.full_name | |
puts my_class.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment