Created
December 21, 2020 10:55
-
-
Save chalmagean/ecacf844ab70c9b9b855c6cb93ba4b59 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 Printer | |
def self.full_name(person) | |
"Your name is: #{person.fname} #{person.lname}" | |
end | |
end | |
class Person | |
attr_reader :fname, :lname | |
def initialize(fname, lname) | |
@fname = fname | |
@lname = lname | |
raise "Firstname too short" if fname.empty? | |
end | |
end | |
john = Person.new("", "Doe") | |
puts Printer.full_name(john) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment