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:, options:, global:) ⇒ Conclude
constructor
A new instance of Conclude.
- #maybe ⇒ Object
- #on(query) ⇒ Object
- #quota_aware ⇒ Object
Constructor Details
#initialize(fb:, judge:, loog:, options:, global:) ⇒ Conclude
Returns a new instance of Conclude.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fbe/conclude.rb', line 41 def initialize(fb:, judge:, loog:, options:, global:) @fb = fb @judge = judge @loog = loog @options = @global = global @query = nil @follows = [] @quota_aware = false end |
Instance Method Details
#consider ⇒ Object
81 82 83 84 85 86 |
# File 'lib/fbe/conclude.rb', line 81 def consider(&) roll do |_fbt, a| yield a nil end end |
#draw ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/fbe/conclude.rb', line 65 def draw(&) roll do |fbt, a| n = fbt.insert fill(n, a, &) n end end |
#follow(props) ⇒ Object
61 62 63 |
# File 'lib/fbe/conclude.rb', line 61 def follow(props) @follows = props.split end |
#maybe ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/fbe/conclude.rb', line 73 def maybe(&) roll do |fbt, a| Fbe.if_absent(fb: fbt) do |n| fill(n, a, &) end end end |
#on(query) ⇒ Object
56 57 58 59 |
# File 'lib/fbe/conclude.rb', line 56 def on(query) raise 'Query is already set' unless @query.nil? @query = query end |
#quota_aware ⇒ Object
52 53 54 |
# File 'lib/fbe/conclude.rb', line 52 def quota_aware @quota_aware = true end |