Class: Use
- Inherits:
-
Object
- Object
- Use
- Defined in:
- lib/Olib/core/use.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
Instance Method Summary collapse
- #both(&block) ⇒ Object
-
#initialize(item, &block) ⇒ Use
constructor
A new instance of Use.
- #left(&block) ⇒ Object
- #right(&block) ⇒ Object
- #run(&block) ⇒ Object
Constructor Details
#initialize(item, &block) ⇒ Use
Returns a new instance of Use.
5 6 7 8 |
# File 'lib/Olib/core/use.rb', line 5 def initialize(item, &block) @item = item both(&block) if block end |
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
3 4 5 |
# File 'lib/Olib/core/use.rb', line 3 def item @item end |
Instance Method Details
#both(&block) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/Olib/core/use.rb', line 32 def both(&block) empty_hands @item.take run &block fill_hands end |
#left(&block) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/Olib/core/use.rb', line 17 def left(&block) empty_left_hand @item.take Char.swap if Char.right.id == @item.id run &block fill_left_hand end |
#right(&block) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/Olib/core/use.rb', line 25 def right(&block) empty_right_hand @item.take run &block fill_right_hand end |