# frozen_string_literal: true module Course class Step attr_reader :target, :options, :block def initialize(target, block, **options) raise ArgumentError, 'Cannot create a step with both name and block' if !target.nil? && !block.nil? raise ArgumentError, 'Step name or block should be passed' if target.nil? && block.nil? @target = target @options = options @block = block end def method? target.is_a?(String) || target.is_a?(Symbol) end def block? !@block.nil? end end end