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:, 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 = options
  @global = global
  @query = nil
  @follows = []
  @quota_aware = false
end

Instance Method Details

#considerObject



81
82
83
84
85
86
# File 'lib/fbe/conclude.rb', line 81

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

#drawObject



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

#maybeObject



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_awareObject



52
53
54
# File 'lib/fbe/conclude.rb', line 52

def quota_aware
  @quota_aware = true
end