Class: Percentage
- Inherits:
-
Object
- Object
- Percentage
- Defined in:
- lib/alea/percentage.rb
Defined Under Namespace
Classes: Chance
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
Instance Method Summary collapse
- #chance ⇒ Object
-
#initialize(amount) ⇒ Percentage
constructor
A new instance of Percentage.
- #of(number, rounded = true) ⇒ Object
Constructor Details
#initialize(amount) ⇒ Percentage
Returns a new instance of Percentage.
3 4 5 |
# File 'lib/alea/percentage.rb', line 3 def initialize(amount) @amount = amount end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
2 3 4 |
# File 'lib/alea/percentage.rb', line 2 def amount @amount end |