Class: Rummage
- Inherits:
-
Object
- Object
- Rummage
- Defined in:
- lib/Olib/core/container.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: SUCCESS.or(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.
207 208 209 |
# File 'lib/Olib/core/container.rb', line 207 def initialize(container) @container = container end |
Instance Attribute Details
#container ⇒ Object
Returns the value of attribute container.
205 206 207 |
# File 'lib/Olib/core/container.rb', line 205 def container @container end |
Class Method Details
.message ⇒ Object
201 202 203 |
# File 'lib/Olib/core/container.rb', line 201 def Rummage. @@message end |
Instance Method Details
#holy(tier) ⇒ Object
228 229 230 |
# File 'lib/Olib/core/container.rb', line 228 def holy(tier) perform "holy", tier end |
#ingredient(str) ⇒ Object
224 225 226 |
# File 'lib/Olib/core/container.rb', line 224 def ingredient(str) perform "ingredient", str end |
#perform(mod, query) ⇒ Object
211 212 213 214 |
# File 'lib/Olib/core/container.rb', line 211 def perform(mod, query) res = Olib.do "rummage ##{@container.id} #{mod} #{query}", Rummage..either [!res.match(FAIL), res] end |
#runestone(rune) ⇒ Object
220 221 222 |
# File 'lib/Olib/core/container.rb', line 220 def runestone(rune) perform "runestone", rune end |
#spell(number) ⇒ Object
216 217 218 |
# File 'lib/Olib/core/container.rb', line 216 def spell(number) perform "spell", number end |