Sha256: 1331d8e9de800d2d4271c328f91116dbbc5cd885c5ae91ef8b117048ad4a1467

Contents?: true

Size: 807 Bytes

Versions: 9

Compression:

Stored size: 807 Bytes

Contents

module Foobara
  module BuiltinTypes
    module Entity
      module Casters
        class PrimaryKey < Value::Caster
          class << self
            def requires_declaration_data?
              true
            end

            def requires_type?
              true
            end
          end

          def entity_class
            declaration_data.target_class
          end

          def primary_key_type
            entity_class.primary_key_type
          end

          def applicable?(value)
            primary_key_type.applicable?(value)
          end

          def transform(primary_key)
            entity_class.thunk(primary_key)
          end

          def applies_message
            primary_key_type.value_caster.applies_message
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foobara-0.0.47 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.46 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.45 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.44 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.43 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.42 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.41 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.40 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb
foobara-0.0.39 projects/entity/src/extensions/builtin_types/entity/casters/primary_key.rb