Class: DiceBag::SimplePart
- Inherits:
-
Object
- Object
- DiceBag::SimplePart
- Defined in:
- lib/dicebag/simple_part.rb
Overview
The most simplest of a part. If a given part of a dice string is not a Label, Fixnum, or a xDx part it will be an instance of this class, which simply returns the value given to it.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(part) ⇒ SimplePart
constructor
A new instance of SimplePart.
- #result ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(part) ⇒ SimplePart
Returns a new instance of SimplePart.
9 10 11 |
# File 'lib/dicebag/simple_part.rb', line 9 def initialize(part) @value = part end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/dicebag/simple_part.rb', line 7 def value @value end |
Instance Method Details
#result ⇒ Object
13 14 15 |
# File 'lib/dicebag/simple_part.rb', line 13 def result value end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/dicebag/simple_part.rb', line 17 def to_s value end |