Sha256: 202ea03e918a4eac6cf521d8a6d68e64eb017bb6a829108ff9cb8b69878a366c

Contents?: true

Size: 581 Bytes

Versions: 23

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Common
    module Plugins
      module HasCallbacks
        module Entities
          class Type
            module ClassMethods
              def cast(other)
                case other
                when ::Symbol
                  Type.new(value: other)
                when ::String
                  Type.new(value: other.to_sym)
                when Type
                  Type.new(value: other.value)
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.19.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.18.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.17.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.16.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.15.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.14.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.13.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.12.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.11.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.10.1 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.10.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.9.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.8.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.7.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.6.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.5.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.4.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.3.1 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb
convenient_service-0.3.0 lib/convenient_service/common/plugins/has_callbacks/entities/type/class_methods.rb