Class: Factbase::Accum

Inherits:
Object
  • Object
show all
Defined in:
lib/factbase/accum.rb

Overview

Accumulator of props, a decorator of Factbase::Fact.

Author

Yegor Bugayenko ([email protected])

Copyright

Copyright © 2024-2025 Yegor Bugayenko

License

MIT

Instance Method Summary collapse

Constructor Details

#initialize(fact, props, pass) ⇒ Accum

Ctor.

Parameters:

  • fact (Factbase::Fact)

    The fact to decorate

  • props (Hash)

    Hash of props that were set

  • pass (Boolean)

    TRUE if all “set” operations must go through, to the fact



19
20
21
22
23
# File 'lib/factbase/accum.rb', line 19

def initialize(fact, props, pass)
  @fact = fact
  @props = props
  @pass = pass
end

Instance Method Details

#all_propertiesObject



29
30
31
# File 'lib/factbase/accum.rb', line 29

def all_properties
  @fact.all_properties
end

#to_sObject



25
26
27
# File 'lib/factbase/accum.rb', line 25

def to_s
  "#{@fact} + #{@props}"
end