Class: Rummage
- Inherits:
-
Object
- Object
- Rummage
- Defined in:
- lib/Olib/core/rummage.rb
Constant Summary collapse
- SUCCESS =
/and remove/
- FAIL =
/but can't seem|^But your hands are full|^You can only rummage for|^What/
- @@message =
OpenStruct.new( success: SUCCESS, fail: FAIL, either: Regexp.union(SUCCESS, FAIL) )
Instance Attribute Summary collapse
-
#container ⇒ Object
Returns the value of attribute container.
Class Method Summary collapse
Instance Method Summary collapse
- #holy(tier) ⇒ Object
- #ingredient(str) ⇒ Object
-
#initialize(container) ⇒ Rummage
constructor
A new instance of Rummage.
- #perform(mod, query) ⇒ Object
- #runestone(rune) ⇒ Object
- #spell(number) ⇒ Object
Constructor Details
#initialize(container) ⇒ Rummage
Returns a new instance of Rummage.
18 19 20 |
# File 'lib/Olib/core/rummage.rb', line 18 def initialize(container) @container = container end |
Instance Attribute Details
#container ⇒ Object
Returns the value of attribute container.
16 17 18 |
# File 'lib/Olib/core/rummage.rb', line 16 def container @container end |
Class Method Details
.message ⇒ Object
12 13 14 |
# File 'lib/Olib/core/rummage.rb', line 12 def self. @@message end |
Instance Method Details
#holy(tier) ⇒ Object
39 40 41 |
# File 'lib/Olib/core/rummage.rb', line 39 def holy(tier) perform "holy", tier end |
#ingredient(str) ⇒ Object
35 36 37 |
# File 'lib/Olib/core/rummage.rb', line 35 def ingredient(str) perform "ingredient", str end |
#perform(mod, query) ⇒ Object
22 23 24 25 |
# File 'lib/Olib/core/rummage.rb', line 22 def perform(mod, query) res = Olib.do "rummage ##{@container.id} #{mod} #{query}", Rummage..either [!res.match(FAIL), res] end |
#runestone(rune) ⇒ Object
31 32 33 |
# File 'lib/Olib/core/rummage.rb', line 31 def runestone(rune) perform "runestone", rune end |
#spell(number) ⇒ Object
27 28 29 |
# File 'lib/Olib/core/rummage.rb', line 27 def spell(number) perform "spell", number end |