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:, global:, options:, loog:) ⇒ Conclude
constructor
Ctor.
- #maybe ⇒ Object
- #on(query) ⇒ Object
- #quota_aware ⇒ Object
Constructor Details
#initialize(fb:, judge:, global:, options:, loog:) ⇒ Conclude
Ctor.
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fbe/conclude.rb', line 54 def initialize(fb:, judge:, global:, options:, loog:) @fb = fb @judge = judge @loog = loog @options = @global = global @query = nil @follows = [] @quota_aware = false end |
Instance Method Details
#consider ⇒ Object
94 95 96 97 98 99 |
# File 'lib/fbe/conclude.rb', line 94 def consider(&) roll do |_fbt, a| yield a nil end end |
#draw ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/fbe/conclude.rb', line 78 def draw(&) roll do |fbt, a| n = fbt.insert fill(n, a, &) n end end |
#follow(props) ⇒ Object
74 75 76 |
# File 'lib/fbe/conclude.rb', line 74 def follow(props) @follows = props.split end |
#maybe ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/fbe/conclude.rb', line 86 def maybe(&) roll do |fbt, a| Fbe.if_absent(fb: fbt) do |n| fill(n, a, &) end end end |
#on(query) ⇒ Object
69 70 71 72 |
# File 'lib/fbe/conclude.rb', line 69 def on(query) raise 'Query is already set' unless @query.nil? @query = query end |
#quota_aware ⇒ Object
65 66 67 |
# File 'lib/fbe/conclude.rb', line 65 def quota_aware @quota_aware = true end |