Created
August 1, 2018 05:39
-
-
Save kitwalker12/9ffc717c5a19f20ab092c435f88391bf to your computer and use it in GitHub Desktop.
barewords
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
def progname; "Dis-organizer"; end | |
module DisOrganizer | |
def version; "Mark 7"; end | |
end | |
class CoffeeEnabled | |
def service_inquiry | |
"order you a coffee" | |
end | |
end | |
class ObsequiousImp | |
include DisOrganizer | |
attr_reader :designation | |
attr_accessor :special_feature | |
def initialize(designation) | |
@designation = designation | |
end | |
def salutation | |
"Most agreeable to see you" | |
end | |
def service_inquiry | |
special_feature.service_inquiry | |
end | |
def greet(title, first_name, last_name) | |
full_name = "#{first_name} #{last_name}" | |
puts "#{salutation}, #{title} #{full_name}. ", | |
"Welcome to #{progname} version #{version}. ", | |
"My name is #{designation}.", | |
"May I #{service_inquiry}?" | |
end | |
end | |
imp = ObsequiousImp.new("Seeree") | |
imp.special_feature = CoffeeEnabled.new | |
imp.greet "Commander", "Sam", "Vimes" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment