Class: Fbe::Conclude

Inherits:
Object
  • Object
show all
Defined in:
lib/fbe/conclude.rb

Overview

Conclude.

Author

Yegor Bugayenko (yegor256@gmail.com)

Copyright

Copyright © 2024 Zerocracy

License

MIT

Instance Method Summary collapse

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

#considerObject



79
80
81
82
83
84
# File 'lib/fbe/conclude.rb', line 79

def consider(&)
  roll do |_fbt, a|
    yield a
    nil
  end
end

#drawObject



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

#maybeObject



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_awareObject



50
51
52
# File 'lib/fbe/conclude.rb', line 50

def quota_aware
  @quota_aware = true
end