Sha256: 179a0150c1cb6b6aa7b3492fc5a9a0713d92e95907b0e14463295d632f5a02cb

Contents?: true

Size: 786 Bytes

Versions: 26

Compression:

Stored size: 786 Bytes

Contents

module Foobara
  module BuiltinTypes
    module Model
      module Validators
        class AttributesDeclaration < TypeDeclarations::Processor
          class << self
            def requires_parent_declaration_data?
              true
            end
          end

          def always_applicable?
            true
          end

          def process_value(model_instance)
            Outcome.new(result: model_instance, errors: model_instance.validation_errors)
          end

          def possible_errors
            model_class_name = parent_declaration_data[:model_class]

            if model_class_name
              Object.const_get(model_class_name).possible_errors
            else
              super
            end
          end
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.25 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.24 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.23 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.22 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.21 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.20 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.19 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.18 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.17 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.16 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.15 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.14 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.13 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.12 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.11 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.10 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.9 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.8 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb
foobara-0.0.7 projects/model/src/extensions/builtin_types/model/validators/attributes_declaration.rb