Skip to content

Instantly share code, notes, and snippets.

@djburdick
Created February 25, 2013 03:55
Show Gist options
  • Save djburdick/5027524 to your computer and use it in GitHub Desktop.
Save djburdick/5027524 to your computer and use it in GitHub Desktop.
ruby module with self method. #ruby
module Party
def full_party?
self == 8? true : false
end
end
include Party
class People
attr_accessor :guests
end
people = People.new
people.guests = 8
puts people.guests.full_party?
people.guests = 6
puts people.guests.full_party?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment