Class: Configatron::Dynamic

Inherits:
Proc show all
Defined in:
lib/configatron/proc.rb

Overview

Tells Configatron to always execute the block at runtime. The results will never be cached.

Example:

configatron.letters = 'a-b-c-d'
configatron.my.letters = Configatron::Delayed.new do
  "My letters are: #{configatron.letters}"
end
configatron.my.other.letters = Configatron::Dynamic.new do
  "My letters are: #{configatron.a.b.c.d}"
end

configatron.my.letters # => 'My letters are: a-b-c-d'
configatron.my.other.letters # => 'My letters are: a-b-c-d'

configatron.letters = 'a-b-c-d-e'

configatron.my.letters # => 'My letters are: a-b-c-d'
configatron.my.other.letters # => 'My letters are: a-b-c-d-e'

Instance Attribute Summary

Attributes inherited from Proc

#block, #execution_count

Instance Method Summary collapse

Methods inherited from Proc

#execute, #initialize

Constructor Details

This class inherits a constructor from Configatron::Proc

Instance Method Details

#finalize?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/configatron/proc.rb', line 76

def finalize?
  false
end