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 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



36
37
38
39
40
# File 'lib/factbase/accum.rb', line 36

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

Instance Method Details

#all_propertiesObject



46
47
48
# File 'lib/factbase/accum.rb', line 46

def all_properties
  @fact.all_properties
end

#to_sObject



42
43
44
# File 'lib/factbase/accum.rb', line 42

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