class Farts::Lib

The Lib class implements all the functions available to Farts programs.

Public Instance Methods

ischaracter(actor) click to toggle source

Is actor a Character

# File lib/farts/farts_lib.rb, line 26
def ischaracter(actor)
  actor.class == Character
end
iscritter(actor) click to toggle source

Is actor a Critter

# File lib/farts/farts_lib.rb, line 31
def iscritter(actor)
  false
end
isroom(actor) click to toggle source

Is actor a Room

# File lib/farts/farts_lib.rb, line 36
def isroom(actor)
  actor.class == Room
end
level(actor) click to toggle source

Get the level of actor

# File lib/farts/farts_lib.rb, line 41
def level(actor)
  99
end
rand(num) click to toggle source

Is random percentage less than or equal to num

# File lib/farts/farts_lib.rb, line 21
def rand(num)
  Kernel::rand(100) < num
end
sex(actor) click to toggle source

Get the sex of actor

# File lib/farts/farts_lib.rb, line 46
def sex(actor)
  :male
end