Sha256: bc0628d89d360e1a300fdceffc73a063fc3ad72ef39b7d57d89d8a9a2b93fe6c

Contents?: true

Size: 761 Bytes

Versions: 5

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Examples
    module Standard
      class RequestParams
        module Entities
          class Format
            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

Version data entries

5 entries across 5 versions & 1 rubygems

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