Class: Oxidized::Jobs
- Inherits:
-
Array
- Object
- Array
- Oxidized::Jobs
- Defined in:
- lib/oxidized/jobs.rb
Instance Attribute Summary collapse
-
#duration(last) ⇒ Object
Returns the value of attribute duration.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#max ⇒ Object
Returns the value of attribute max.
-
#want ⇒ Object
Returns the value of attribute want.
Instance Method Summary collapse
-
#initialize(max, interval, nodes) ⇒ Jobs
constructor
A new instance of Jobs.
- #new_count ⇒ Object
Constructor Details
#initialize(max, interval, nodes) ⇒ Jobs
Returns a new instance of Jobs.
4 5 6 7 8 9 10 11 12 |
# File 'lib/oxidized/jobs.rb', line 4 def initialize max, interval, nodes @max = max #@interval = interval * 60 @interval = interval @nodes = nodes @duration = 4 new_count super() end |
Instance Attribute Details
#duration(last) ⇒ Object
Returns the value of attribute duration.
3 4 5 |
# File 'lib/oxidized/jobs.rb', line 3 def duration @duration end |
#interval ⇒ Object
Returns the value of attribute interval.
3 4 5 |
# File 'lib/oxidized/jobs.rb', line 3 def interval @interval end |
#max ⇒ Object
Returns the value of attribute max.
3 4 5 |
# File 'lib/oxidized/jobs.rb', line 3 def max @max end |
#want ⇒ Object
Returns the value of attribute want.
3 4 5 |
# File 'lib/oxidized/jobs.rb', line 3 def want @want end |
Instance Method Details
#new_count ⇒ Object
17 18 19 20 21 22 |
# File 'lib/oxidized/jobs.rb', line 17 def new_count @want = ((@nodes.size * @duration) / @interval).to_i @want = 1 if @want < 1 @want = @nodes.size if @want > @nodes.size @want = @max if @want > @max end |