Skip to content

Instantly share code, notes, and snippets.

@nafidurmus
Last active July 26, 2019 12:42
Show Gist options
  • Save nafidurmus/d58f3979eab648458e6daf2495a00263 to your computer and use it in GitHub Desktop.
Save nafidurmus/d58f3979eab648458e6daf2495a00263 to your computer and use it in GitHub Desktop.
class EventDirector
def initialize
@subevents = [:welcome, :intermediary,:closing]
end
def organize event
@subevents.each { |se| event.send(se) if event.respond_to? se }
end
end
class Wedding
def welcome
puts 'give welcome drink'
end
def intermediary
puts 'Exchange of vows,Exchange of rings'
end
def closing
puts 'closing prayer'
end
end
class TeamParty
def welcome
puts 'give complementry mocktail or beer :)'
end
def intermediary
puts 'Team building activities'
end
def closing
puts 'team photo'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment