Skip to content

Instantly share code, notes, and snippets.

@sebyx07
Created July 5, 2014 17:13
Show Gist options
  • Save sebyx07/19acb256ce733ebc8a2f to your computer and use it in GitHub Desktop.
Save sebyx07/19acb256ce733ebc8a2f to your computer and use it in GitHub Desktop.
roles = {
spectator: [:send_message],
memeber: [:send_message, :change_slot],
captain: [:send_message, :change_slot, :start_game]
}
def send_message(options={})
message = options[:message]
party = options[:party]
role = self.current_role(party)
if checkIfValidAction(role, #???)
#.....
end
end
def checkIfValidAction(party, action)
#????????
end
@fivetwentysix
Copy link

roles.include?(options[:action])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment