Class: Fbe::Award

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

Overview

Award generator.

Author

Yegor Bugayenko (yegor256@gmail.com)

Copyright

Copyright © 2024 Yegor Bugayenko

License

MIT

Defined Under Namespace

Classes: BTerm, Bill, PTerm, Policy

Instance Method Summary collapse

Constructor Details

#initialize(query = J.pmp.hr.send($judge.gsub('-', '_'))) ⇒ Award

Returns a new instance of Award.



32
33
34
# File 'lib/fbe/award.rb', line 32

def initialize(query = J.pmp.hr.send($judge.gsub('-', '_')))
  @query = query
end

Instance Method Details

#bill(vars = {}) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/fbe/award.rb', line 36

def bill(vars = {})
  term = Factbase::Syntax.new(@query, term: Fbe::Award::BTerm).to_term
  bill = Bill.new
  vars.each { |k, v| bill.set(k, v) }
  term.bill_to(bill)
  bill
end

#policyObject



44
45
46
47
48
49
# File 'lib/fbe/award.rb', line 44

def policy
  term = Factbase::Syntax.new(@query, term: Fbe::Award::PTerm).to_term
  policy = Policy.new
  term.publish_to(policy)
  policy
end