class Woyo::Character

Public Instance Methods

go(way_or_id) click to toggle source
# File lib/woyo/world/character.rb, line 24
def go way_or_id
  id = way_or_id.kind_of?(Way) ? way_or_id.id : way_or_id
  way = @location.ways[id]
  @location.characters.delete me.id
  @location = way.to
  @location.characters[me.id] = me
end
initialize_object() click to toggle source
Calls superclass method
# File lib/woyo/world/character.rb, line 7
def initialize_object
  super
  attributes :description, name: lambda { |this| this.id.to_s.capitalize }
end
location() click to toggle source
# File lib/woyo/world/character.rb, line 16
def location
  @location ||= context if context.is_a? Location
end
me() click to toggle source
# File lib/woyo/world/character.rb, line 20
def me
  self
end
world() click to toggle source
# File lib/woyo/world/character.rb, line 12
def world
  @world ||= context if context.is_a? World
end