Class: Fbe::Conclude
- Inherits:
-
Object
- Object
- Fbe::Conclude
- Defined in:
- lib/fbe/conclude.rb
Overview
Conclude.
- Author
-
Yegor Bugayenko (yegor256@gmail.com)
- Copyright
-
Copyright © 2024 Zerocracy
- License
-
MIT
Instance Method Summary collapse
- #consider ⇒ Object
- #draw ⇒ Object
- #follow(props) ⇒ Object
-
#initialize(fb, judge, loog) ⇒ Conclude
constructor
A new instance of Conclude.
- #maybe ⇒ Object
- #on(query) ⇒ Object
- #quota_aware ⇒ Object
- #threshold(max) ⇒ Object
Constructor Details
#initialize(fb, judge, loog) ⇒ Conclude
Returns a new instance of Conclude.
41 42 43 44 45 46 47 48 49 |
# File 'lib/fbe/conclude.rb', line 41 def initialize(fb, judge, loog) @fb = fb @judge = judge @loog = loog @query = nil @follows = [] @threshold = 9999 @quota_aware = false end |
Instance Method Details
#consider ⇒ Object
84 85 86 87 88 89 |
# File 'lib/fbe/conclude.rb', line 84 def consider(&) roll do |_fbt, a| yield a nil end end |
#draw ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/fbe/conclude.rb', line 68 def draw(&) roll do |fbt, a| n = fbt.insert fill(n, a, &) n end end |
#follow(props) ⇒ Object
64 65 66 |
# File 'lib/fbe/conclude.rb', line 64 def follow(props) @follows = props.split end |
#maybe ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/fbe/conclude.rb', line 76 def maybe(&) roll do |fbt, a| Fbe.if_absent(fbt) do |n| fill(n, a, &) end end end |
#on(query) ⇒ Object
55 56 57 58 |
# File 'lib/fbe/conclude.rb', line 55 def on(query) raise 'Query is already set' unless @query.nil? @query = query end |
#quota_aware ⇒ Object
51 52 53 |
# File 'lib/fbe/conclude.rb', line 51 def quota_aware @quota_aware = true end |
#threshold(max) ⇒ Object
60 61 62 |
# File 'lib/fbe/conclude.rb', line 60 def threshold(max) @threshold = max end |