Sha256: 08721f6388da8ec8a580e1550aabd1ab067eed87c7d6497dabe95a45b5cec580

Contents?: true

Size: 309 Bytes

Versions: 35

Compression:

Stored size: 309 Bytes

Contents

class Terraspace::App
  class Hooks
    class_attribute :hooks
    self.hooks = {}

    def on_boot(&block)
      self.class.hooks[:on_boot] = block
    end

    class << self
      def run_hook(name)
        name = name.to_sym
        hook = hooks[name]
        hook.call if hook
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
terraspace-0.6.1 lib/terraspace/app/hooks.rb
terraspace-0.6.0 lib/terraspace/app/hooks.rb
terraspace-0.5.12 lib/terraspace/app/hooks.rb
terraspace-0.5.11 lib/terraspace/app/hooks.rb
terraspace-0.5.10 lib/terraspace/app/hooks.rb
terraspace-0.5.9 lib/terraspace/app/hooks.rb
terraspace-0.5.8 lib/terraspace/app/hooks.rb
terraspace-0.5.7 lib/terraspace/app/hooks.rb
terraspace-0.5.6 lib/terraspace/app/hooks.rb
terraspace-0.5.5 lib/terraspace/app/hooks.rb
terraspace-0.5.4 lib/terraspace/app/hooks.rb
terraspace-0.5.3 lib/terraspace/app/hooks.rb
terraspace-0.5.2 lib/terraspace/app/hooks.rb
terraspace-0.5.1 lib/terraspace/app/hooks.rb
terraspace-0.5.0 lib/terraspace/app/hooks.rb
terraspace-0.4.4 lib/terraspace/app/hooks.rb
terraspace-0.4.3 lib/terraspace/app/hooks.rb
terraspace-0.4.2 lib/terraspace/app/hooks.rb
terraspace-0.4.1 lib/terraspace/app/hooks.rb
terraspace-0.4.0 lib/terraspace/app/hooks.rb