Module: SnFoil::Context

Extended by:
ActiveSupport::Concern
Defined in:
lib/snfoil/context.rb,
lib/snfoil/context/error.rb,
lib/snfoil/context/version.rb,
lib/snfoil/context/structure.rb,
lib/snfoil/context/argument_error.rb

Overview

ActiveSupport::Concern for adding SnFoil Context functionality

Author:

  • Matthew Howes

Since:

  • 0.1.0

Defined Under Namespace

Modules: Structure Classes: ArgumentError, Error

Constant Summary collapse

VERSION =

Since:

  • 0.1.0

'1.2.1'

Instance Method Summary collapse

Instance Method Details

#run_interval(interval, **options) ⇒ Object

Since:

  • 0.1.0



55
56
57
58
59
# File 'lib/snfoil/context.rb', line 55

def run_interval(interval, **options)
  hooks = self.class.instance_variable_get("@snfoil_#{interval}_hooks") || []
  options = hooks.reduce(options) { |opts, hook| run_hook(hook, **opts) }
  send(interval, **options)
end