Class: Prorate::LeakyBucket::BucketState
- Inherits:
-
Struct
- Object
- Struct
- Prorate::LeakyBucket::BucketState
- Defined in:
- lib/prorate/leaky_bucket.rb
Instance Attribute Summary collapse
- #full ⇒ Boolean (also: #full?)
- #level ⇒ Float
Instance Method Summary collapse
-
#to_f ⇒ Float
Returns the bucket level of the bucket state as a Float.
-
#to_i ⇒ Integer
Returns the bucket level of the bucket state rounded to an Integer.
Instance Attribute Details
#full ⇒ Boolean Also known as: full?
39 40 41 |
# File 'lib/prorate/leaky_bucket.rb', line 39 def full @full end |
#level ⇒ Float
23 24 25 |
# File 'lib/prorate/leaky_bucket.rb', line 23 def level @level end |
Instance Method Details
#to_f ⇒ Float
Returns the bucket level of the bucket state as a Float
44 45 46 |
# File 'lib/prorate/leaky_bucket.rb', line 44 def to_f level.to_f end |
#to_i ⇒ Integer
Returns the bucket level of the bucket state rounded to an Integer
51 52 53 |
# File 'lib/prorate/leaky_bucket.rb', line 51 def to_i level.to_i end |