Sha256: 43938ba7ebf501029a9b7991ecd939379846c478e52269005c7be815bf00e751

Contents?: true

Size: 422 Bytes

Versions: 2

Compression:

Stored size: 422 Bytes

Contents

# frozen_string_literal: true

module Atacama
  # Struct object holding the step definition
  class Definition < Contract
    option :name, type: Types::Strict::Symbol
    option :with, type: Types::Any.optional
    option :yielding, type: Types::Any.optional

    def yielding?
      !!yielding
    end

    def proc_invocation?
      with.is_a? Proc
    end

    def method_invocation?
      with.nil?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
atacama-0.1.1 lib/atacama/transaction/definition.rb
atacama-0.1.0 lib/atacama/transaction/definition.rb