Class: Qfill::Strategy::Base
- Inherits:
-
Object
- Object
- Qfill::Strategy::Base
show all
- Extended by:
- Forwardable
- Defined in:
- lib/qfill/strategy/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(manager) ⇒ Base
Returns a new instance of Base.
23
24
25
26
27
28
|
# File 'lib/qfill/strategy/base.rb', line 23
def initialize(manager)
@manager = manager
@added = 0
@tally = 0
@ratio_modifier = 1
end
|
Instance Attribute Details
#added ⇒ Object
Returns the value of attribute added.
19
20
21
|
# File 'lib/qfill/strategy/base.rb', line 19
def added
@added
end
|
#ratio_modifier ⇒ Object
Returns the value of attribute ratio_modifier.
19
20
21
|
# File 'lib/qfill/strategy/base.rb', line 19
def ratio_modifier
@ratio_modifier
end
|
#tally ⇒ Object
Returns the value of attribute tally.
19
20
21
|
# File 'lib/qfill/strategy/base.rb', line 19
def tally
@tally
end
|
Instance Method Details
#bump! ⇒ Object
55
56
57
58
|
# File 'lib/qfill/strategy/base.rb', line 55
def bump!
self.tally += added
self.fill_count += added
end
|
#default_pusher ⇒ Object
51
52
53
|
# File 'lib/qfill/strategy/base.rb', line 51
def default_pusher
end
|
#fill_according_to_list_ratios! ⇒ Object
Go through the queues this result should be filled from and push elements from them onto the current result list.
43
44
45
|
# File 'lib/qfill/strategy/base.rb', line 43
def fill_according_to_list_ratios!
raise NotImplementedError
end
|
#fill_to_ratio! ⇒ Object
38
39
40
|
# File 'lib/qfill/strategy/base.rb', line 38
def fill_to_ratio!
raise NotImplementedError
end
|
#fill_up_to_ratio! ⇒ Object
47
48
49
|
# File 'lib/qfill/strategy/base.rb', line 47
def fill_up_to_ratio!
raise NotImplementedError
end
|
#name ⇒ Object
30
31
32
|
# File 'lib/qfill/strategy/base.rb', line 30
def name
NAME
end
|
#on_fill! ⇒ Object
34
35
36
|
# File 'lib/qfill/strategy/base.rb', line 34
def on_fill!
raise NotImplementedError
end
|
#remaining ⇒ Object
60
61
62
|
# File 'lib/qfill/strategy/base.rb', line 60
def remaining
all_list_max - fill_count
end
|