Class: Prorate::LeakyBucket::BucketState

Inherits:
Struct
  • Object
show all
Defined in:
lib/prorate/leaky_bucket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fullBoolean Also known as: full?

Returns:

  • (Boolean)


39
40
41
# File 'lib/prorate/leaky_bucket.rb', line 39

def full
  @full
end

#levelFloat

Returns:

  • (Float)


23
24
25
# File 'lib/prorate/leaky_bucket.rb', line 23

def level
  @level
end

Instance Method Details

#to_fFloat

Returns the bucket level of the bucket state as a Float

Returns:

  • (Float)


44
45
46
# File 'lib/prorate/leaky_bucket.rb', line 44

def to_f
  level.to_f
end

#to_iInteger

Returns the bucket level of the bucket state rounded to an Integer

Returns:

  • (Integer)


51
52
53
# File 'lib/prorate/leaky_bucket.rb', line 51

def to_i
  level.to_i
end