Sha256: 3722bbac94ba29620a0f352af49d75949f867c4dc06a2c74756b5defe4105b77

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 Bytes

Contents

module Hyperloop
  # insure at least a stub of operation is defined.  If
  # Hyperloop::Operation is already loaded it will have
  # defined these.
  class Operation
    class << self
      def on_dispatch(&block)
        receivers << block
      end

      def receivers
        @receivers ||= []
      end
    end
  end unless defined? Operation
  class Application
    class Boot < Operation
      class ReactDummyParams
        attr_reader :context
        def initialize(context)
          @context = context
        end
      end
      def self.run(context: nil)
        params = ReactDummyParams.new(context)
        receivers.each do |receiver|
          receiver.call params
        end
      rescue Exception => e
        puts "called Boot.run and she broke #{e}"
      end
    end unless defined? Boot
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hyper-store-0.2.1 lib/hyperloop/application/boot.rb
hyper-store-0.2.0 lib/hyperloop/application/boot.rb