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