Class: BagOfHolding::Dice::ConstantResult
- Inherits:
-
Object
- Object
- BagOfHolding::Dice::ConstantResult
- Defined in:
- lib/bag_of_holding/dice/constant_result.rb
Overview
Internal: Present the ‘result’ of a constant with a result API so it can be used interchangeably with an OperationResult or a PoolResult
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value: nil) ⇒ ConstantResult
constructor
A new instance of ConstantResult.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value: nil) ⇒ ConstantResult
Returns a new instance of ConstantResult.
8 9 10 |
# File 'lib/bag_of_holding/dice/constant_result.rb', line 8 def initialize(value: nil) self.value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/bag_of_holding/dice/constant_result.rb', line 6 def value @value end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 23 24 |
# File 'lib/bag_of_holding/dice/constant_result.rb', line 20 def ==(other) return false unless other.respond_to? :value return false unless value == other.value true end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/bag_of_holding/dice/constant_result.rb', line 16 def inspect value.to_s end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/bag_of_holding/dice/constant_result.rb', line 12 def to_s value.to_s end |