Class: BagOfHolding::Dice::SubtractionOperation
- Inherits:
-
Operation
- Object
- Operation
- BagOfHolding::Dice::SubtractionOperation
show all
- Defined in:
- lib/bag_of_holding/dice/subtraction_operation.rb
Overview
Internal: Encapsulates subtracting two expressions
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/subtraction_operation.rb', line 5
def self.operator
'-'
end
|
Instance Method Details
#operator ⇒ Object
13
14
15
|
# File 'lib/bag_of_holding/dice/subtraction_operation.rb', line 13
def operator
'-'
end
|
#value ⇒ Object
9
10
11
|
# File 'lib/bag_of_holding/dice/subtraction_operation.rb', line 9
def value
left_result.value - right_result.value
end
|