Class: Jewelry

Inherits:
Olib::Item show all
Defined in:
lib/Olib/objects/jewelry.rb

Constant Summary collapse

HEIRLOOM =
/are the initials ([A-Z]{2})./

Constants inherited from Olib::Item

Olib::Item::SOLD, Olib::Item::TYPES, Olib::Item::WORTHLESS, Olib::Item::WRONG_SHOP

Instance Attribute Summary collapse

Attributes inherited from Olib::Item

#container, #props

Attributes inherited from Olib::Gameobj_Extender

#type

Instance Method Summary collapse

Methods inherited from Olib::Item

#==, #_drag, #_inspect, #acquire_from_shop, #action, #add, #affordable?, #analyze, #buy, #buyable?, #cost, #crawl, #define, #drop, #exists?, #give, #has?, #in, #initialize, #is?, #look, #missing?, #price, #pull, #pullable?, #read, #remove, #sell, #shake, #shop_sell, #stash, #tag, #tags, #take, #tap, #to_s, #turn, type_methods, #untag, #use, #wear, #worn?

Methods inherited from Olib::Gameobj_Extender

#__extend__, #at, #echo, #initialize

Constructor Details

This class inherits a constructor from Olib::Item

Instance Attribute Details

#heirloomObject

Returns the value of attribute heirloom


4
5
6
# File 'lib/Olib/objects/jewelry.rb', line 4

def heirloom
  @heirloom
end

Instance Method Details

#heirloom?Boolean

Returns:

  • (Boolean)

5
6
7
8
9
# File 'lib/Olib/objects/jewelry.rb', line 5

def heirloom?
  result = Olib.do "look ##{@id}", /^You see nothing unusual/ | HEIRLOOM
  @heirloom = result =~ HEIRLOOM ? true : false
  @heirloom
end