Class: BagOfHolding::Dice::DivisionOperation

Inherits:
Operation
  • Object
show all
Defined in:
lib/bag_of_holding/dice/division_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

Constructor Details

This class inherits a constructor from BagOfHolding::Dice::Operation

Class Method Details

.operatorObject



5
6
7
# File 'lib/bag_of_holding/dice/division_operation.rb', line 5

def self.operator
  '/'
end

Instance Method Details

#operatorObject



13
14
15
# File 'lib/bag_of_holding/dice/division_operation.rb', line 13

def operator
  '/'
end

#valueObject



9
10
11
# File 'lib/bag_of_holding/dice/division_operation.rb', line 9

def value
  left_result.value / right_result.value
end