Sha256: 7df083825d503cfccb10ed791e60a595293d80786f488701c5d75e013d7beafe
Contents?: true
Size: 454 Bytes
Versions: 2
Compression:
Stored size: 454 Bytes
Contents
module StudioGame module Playable #needs to write to health and read name def blam self.health -= 10 # the .self is REQUIRED on writable attributes (health) puts "#{name} got blammed!" # the .self is optional on readable attributes (name) end def w00t self.health += 15 puts "#{name} got w00ted!" end def strong? health > 100 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
j_studio_game-1.0.2 | lib/playable_module.rb |
j_studio_game-1.0.1 | lib/playable_module.rb |