Sha256: 090bee73699faa260df4e9699d76fd9426d620666a092a8398715d54c9417f90

Contents?: true

Size: 908 Bytes

Versions: 7

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.5.0
class SmartCore::Operation::Step
  # @return [String, Symbol]
  #
  # @api private
  # @since 0.5.0
  attr_reader :method_name

  # @return [Hash<Symbol,Any>]
  #
  # @api private
  # @since 0.5.0
  attr_reader :options

  # @param method_name [String, Symbol]
  # @param options [Hash<Symbol,Any>]
  # @return [void]
  #
  # @api private
  # @since 0.5.0
  def initialize(method_name, **options)
    unless method_name.is_a?(Symbol) || method_name.is_a?(String)
      raise(
        SmartCore::Operation::IncorrectStepNameError,
        'Step name should be a symbol or a string'
      )
    end

    @method_name = method_name.to_sym
    @options = options # TODO: support for another operations
  end

  # @return [SmartCore::Operation::Step]
  #
  # @api private
  # @since 0.5.0
  def dup
    self.class.new(method_name, **options)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
smart_core-0.8.1 lib/smart_core/operation/step.rb
smart_core-0.8.0 lib/smart_core/operation/step.rb
smart_core-0.7.0 lib/smart_core/operation/step.rb
smart_core-0.6.0 lib/smart_core/operation/step.rb
smart_core-0.5.2 lib/smart_core/operation/step.rb
smart_core-0.5.1 lib/smart_core/operation/step.rb
smart_core-0.5.0 lib/smart_core/operation/step.rb