Class: GamesAndRpgParadise::Mud::Food

Inherits:
MudObject
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/mud/food/food.rb

Overview

RpgParadise::Mud::Food

Constant Summary

Constants inherited from MudObject

MudObject::DEFAULT_NAME, MudObject::NAMESPACE

Instance Method Summary collapse

Methods inherited from MudObject

[], #add, #add_prop, #add_to_inventory, #alias_action, #can_speak?, #define_action, #describe_the_mud_object, #description?, disable_debug, #empty?, enable_debug, #enable_speak, #find, #has_inventory?, #height?, #id?, #inspect, #internal_hash?, #inventory?, #is_armour?, #is_inventory?, #is_mud_object?, #is_weapon?, #is_wearable?, #length?, #method_missing, #name=, #name?, #obtain_name_from_filename, #random_inventory_element, #report_height, #report_weight, #run, #set_description, #set_height, #set_is_an_armour, #set_is_inventory, #set_is_wearable, #set_length, #set_name, #set_object_name, #set_value, #set_weight, shall_we_debug?, #show_inventory, #store, #store_where?, #value?, #wear, #wearables?, #weight?, #who_am_i?, #wields?

Constructor Details

#initialize(optional_type = nil) ⇒ Food

#

initialize

#


22
23
24
25
26
27
28
29
# File 'lib/games_and_rpg_paradise/mud/food/food.rb', line 22

def initialize(
    optional_type = nil
  )
  super
  if optional_type
    set_type(optional_type)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GamesAndRpgParadise::Mud::MudObject

Instance Method Details

#resetObject

#

reset

#


43
44
45
46
47
48
49
50
51
52
# File 'lib/games_and_rpg_paradise/mud/food/food.rb', line 43

def reset
  # ======================================================================= #
  # === @taste
  # ======================================================================= #
  @taste = 'good'
  # ======================================================================= #
  # === @type    
  # ======================================================================= #
  @type  = 'bread'
end

#set_type(i) ⇒ Object

#

set_type

Describe the generic taste for a food.

#


36
37
38
# File 'lib/games_and_rpg_paradise/mud/food/food.rb', line 36

def set_type(i)
  @type = i.to_s
end

#taste?Boolean

#

taste?

#

Returns:

  • (Boolean)


57
58
59
# File 'lib/games_and_rpg_paradise/mud/food/food.rb', line 57

def taste?
  @taste
end