Skip to content

Instantly share code, notes, and snippets.

@kitwalker12
Created August 1, 2018 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitwalker12/9ffc717c5a19f20ab092c435f88391bf to your computer and use it in GitHub Desktop.
Save kitwalker12/9ffc717c5a19f20ab092c435f88391bf to your computer and use it in GitHub Desktop.
barewords
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