Sha256: f35fb5a94c4bcc7f664d9fb5589f2d9787edb94fa0c72a68d8d63f28eb3152ec

Contents?: true

Size: 506 Bytes

Versions: 1

Compression:

Stored size: 506 Bytes

Contents

# frozen_string_literal: true

require "core/inspect"

module Core
  module Operation
    module Actions
      # [public] An operation action defined as a block.
      #
      class Block < Action
        include Core::Inspect

        def initialize(name = nil, &block)
          @block = block

          super(name)
        end

        # [public]
        #
        def finalize(context)
          context.define_method(@reference, &@block)

          @reference
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
core-operation-0.2.0 lib/core/operation/actions/block.rb