Class: Lich::Gemstone::Treasure
- Inherits:
-
Object
- Object
- Lich::Gemstone::Treasure
- Defined in:
- documented/gemstone/creature.rb
Overview
Represents the treasure associated with a creature.
Instance Method Summary collapse
- #blunt_required? ⇒ Boolean
- #has_boxes? ⇒ Boolean
- #has_coins? ⇒ Boolean
- #has_gems? ⇒ Boolean
- #has_skin? ⇒ Boolean
-
#initialize(data = {}) ⇒ Treasure
constructor
A new instance of Treasure.
- #to_h ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Treasure
Returns a new instance of Treasure.
616 617 618 619 620 621 622 623 624 625 626 |
# File 'documented/gemstone/creature.rb', line 616 def initialize(data = {}) @data = { coins: false, gems: false, boxes: false, skin: nil, magic_items: nil, other: nil, blunt_required: false }.merge(data) end |
Instance Method Details
#blunt_required? ⇒ Boolean
632 |
# File 'documented/gemstone/creature.rb', line 632 def blunt_required? = !!@data[:blunt_required] |
#has_boxes? ⇒ Boolean
630 |
# File 'documented/gemstone/creature.rb', line 630 def has_boxes? = !!@data[:boxes] |
#has_coins? ⇒ Boolean
628 |
# File 'documented/gemstone/creature.rb', line 628 def has_coins? = !!@data[:coins] |
#has_gems? ⇒ Boolean
629 |
# File 'documented/gemstone/creature.rb', line 629 def has_gems? = !!@data[:gems] |
#has_skin? ⇒ Boolean
631 |
# File 'documented/gemstone/creature.rb', line 631 def has_skin? = !!@data[:skin] |
#to_h ⇒ Object
634 |
# File 'documented/gemstone/creature.rb', line 634 def to_h = @data |