Sha256: aa4369805e199100a7f5baedc9bc8c6ae13e9a723c7f5a9cded452c9907f85c6

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasResult
        module Entities
          class Result
            module Entities
              class Message
                module ClassMethods
                  def cast(other)
                    case other
                    when ::String
                      new(value: other)
                    when ::Symbol
                      new(value: other.to_s)
                    when Message
                      new(value: other.value)
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
convenient_service-0.1.0 lib/convenient_service/service/plugins/has_result/entities/result/entities/message/class_methods.rb