class Gemwarrior::Apple
Public Class Methods
new()
click to toggle source
Calls superclass method
Gemwarrior::Item::new
# File lib/gemwarrior/entities/items/apple.rb, line 8 def initialize super self.name = 'apple' self.name_display = 'Apple' self.description = 'Reddish-orangeish in color, this fruit looks sweet, but it is heavy and feels more like a rock you would sooner not bite into.' self.takeable = true end
Public Instance Methods
use(world)
click to toggle source
# File lib/gemwarrior/entities/items/apple.rb, line 17 def use(world) if !self.used puts 'You attempt to consume the apple, but stop midway through your first bite. Something tells you this is not a good idea, and you stop.' puts self.used = true else puts 'Remembering the odd feeling you got the last time you attempted to use the apple, you refrain.' { type: nil, data: nil } end end