Class: BagOfHolding::Dice::AdditionOperation
- Inherits:
-
Operation
- Object
- Operation
- BagOfHolding::Dice::AdditionOperation
show all
- Defined in:
- lib/bag_of_holding/dice/addition_operation.rb
Overview
Internal: Encapsulates an operation such as adding two dice pools
Instance Attribute Summary
Attributes inherited from Operation
#left, #right
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Operation
#==, #initialize, #roll
Class Method Details
.operator ⇒ Object
5
6
7
|
# File 'lib/bag_of_holding/dice/addition_operation.rb', line 5
def self.operator
'+'
end
|
Instance Method Details
#operator ⇒ Object
13
14
15
|
# File 'lib/bag_of_holding/dice/addition_operation.rb', line 13
def operator
'+'
end
|
#value ⇒ Object
9
10
11
|
# File 'lib/bag_of_holding/dice/addition_operation.rb', line 9
def value
left_result.value + right_result.value
end
|