Sha256: f46a7d9a5fea1bc27eccbf6a0fdb24a60c432465873c5c0b00eca0abc05e3494

Contents?: true

Size: 643 Bytes

Versions: 1

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasResult
        module Entities
          class Result
            module Entities
              class Data
                module ClassMethods
                  def cast(other)
                    case other
                    when ::Hash
                      new(value: other.transform_keys(&:to_sym))
                    when Data
                      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/data/class_methods.rb