Sha256: 8e179cf90012b507815999a50aa78fe2f64b70a0abcf8264d19cfc65d9b8e242

Contents?: true

Size: 875 Bytes

Versions: 10

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
convenient_service-0.9.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.8.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.7.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.6.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.5.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.4.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.3.1 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.3.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.2.1 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb
convenient_service-0.2.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/entities/code/class_methods.rb