Sha256: 871174731f9ef36d6b9fe7ceff18bbebc49eb1e3ac29981d3dd75229703c5282

Contents?: true

Size: 888 Bytes

Versions: 13

Compression:

Stored size: 888 Bytes

Contents

# frozen_string_literal: true

require 'atacama/contract'

module Atacama
  module Values
    # Helper methods for emitting value objects inside of a Contract.
    module Methods
      # rubocop:disable Naming/MethodName

      # This value tells the orchestrator to merge in these parameters on the
      # next call.
      # @param [Hash] the hash object to merge
      def Option(value)
        Values::Option.call(value: value)
      end

      def Return(value)
        Values::Return.call(value: value)
      end
      # rubocop:enable Naming/MethodName
    end

    # This object notifies the Transaction that a new variable needs to be
    # merged in to the current context.
    class Option < Contract
      option :value, type: Types::Strict::Hash
    end

    # This object notifies the Transaction that a new
    class Return < Contract
      option :value
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
atacama-0.2.2 lib/atacama/values.rb
atacama-0.2.1 lib/atacama/values.rb
atacama-0.2.0 lib/atacama/values.rb
atacama-0.1.11 lib/atacama/values.rb
atacama-0.1.10 lib/atacama/values.rb
atacama-0.1.9 lib/atacama/values.rb
atacama-0.1.8 lib/atacama/values.rb
atacama-0.1.7 lib/atacama/values.rb
atacama-0.1.6 lib/atacama/values.rb
atacama-0.1.5 lib/atacama/values.rb
atacama-0.1.4 lib/atacama/values.rb
atacama-0.1.3 lib/atacama/values.rb
atacama-0.1.2 lib/atacama/values.rb