Sha256: e77fafe9107b60813664614294d3e533af342dd1cef3a347b9113a6ae6c8875d

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

require_relative "../helpers/parameter_finder_with_method_missing_mixin"
require_relative "../helpers/parameter_bag_with_registrator"

module Kanal
  module Core
    module Output
      # Base class for constructing output that will be given
      # from router node
      class Output
        include Helpers
        include Helpers::ParameterFinderWithMethodMissingMixin

        attr_reader :input, :core

        #
        # @param parameter_registrator [Kanal::Core::Helpers::ParameterRegistrator] 
        # @param input [Kanal::Core::Input::Input] input required for dsl in respond blocks to have access to input
        # @param core [Kanal::Core::Core] core required also for dsl to access services or other information about core
        def initialize(parameter_registrator, input, core)
          @core = core
          @input = input
          @parameter_bag = ParameterBagWithRegistrator.new parameter_registrator
        end

        def configure_dsl(&block)
          instance_eval(&block)
        end

        private :core
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kanal-0.7.0 lib/kanal/core/output/output.rb
kanal-0.6.0 lib/kanal/core/output/output.rb
kanal-0.5.1 lib/kanal/core/output/output.rb