Sha256: 537c9ade400aca0ca7f44d706f0b78e9491e1549b59104c87852f7717acc2c8e

Contents?: true

Size: 839 Bytes

Versions: 4

Compression:

Stored size: 839 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Examples
    module Standard
      module V1
        class RequestParams
          module Entities
            class Source
              def initialize(value:)
                @value = value
              end

              class << self
                def cast(value)
                  case value
                  when ::String
                    new(value: value.to_s)
                  end
                end
              end

              def ==(other)
                return unless other.instance_of?(self.class)

                value == other.value
              end

              def to_s
                value
              end

              protected

              attr_reader :value
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.17.0 lib/convenient_service/examples/standard/v1/request_params/entities/source.rb
convenient_service-0.16.0 lib/convenient_service/examples/standard/v1/request_params/entities/source.rb
convenient_service-0.15.0 lib/convenient_service/examples/standard/v1/request_params/entities/source.rb
convenient_service-0.14.0 lib/convenient_service/examples/standard/v1/request_params/entities/source.rb