Sha256: 8997857474ffd98aae38d7f156c369a275ada131fa0d1d5aec3acaa4befbc1a8

Contents?: true

Size: 1.64 KB

Versions: 8

Compression:

Stored size: 1.64 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module CanHaveSteps
        module Entities
          class Method
            module Entities
              class Key
                include Support::Copyable
                include Support::Delegate

                ##
                # @!attribute [r] value
                #   @return [Symbol]
                #
                attr_reader :value

                ##
                # @return [String]
                #
                delegate :to_s, :to_sym, to: :value

                ##
                # @return [Symbol]
                #
                delegate :to_sym, to: :value

                ##
                # @param value [Symbol]
                # @return [void]
                #
                def initialize(value)
                  @value = value
                end

                ##
                # @param other [Object] Can be any type.
                # @return [Boolean, nil]
                #
                def ==(other)
                  return unless other.instance_of?(self.class)

                  return false if value != other.value

                  true
                end

                ##
                # @return [Array<Object>]
                #
                def to_args
                  to_arguments.args
                end

                ##
                # @return [ConveninentService::Support::Arguments]
                #
                def to_arguments
                  Support::Arguments.new(value)
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb
convenient_service-0.19.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb
convenient_service-0.18.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb
convenient_service-0.17.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb
convenient_service-0.16.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb
convenient_service-0.15.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb
convenient_service-0.14.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb
convenient_service-0.13.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/key.rb