Class: Canvas::Validator::SchemaAttribute::Link

Inherits:
Base
  • Object
show all
Defined in:
lib/canvas/validators/schema_attributes/link.rb

Overview

:documented: Attribute validations specific to link-type variables.

Constant Summary collapse

ALLOWED_DEFAULT_KEYS =
%w[url page post experience accommodation].freeze
INVALID_DEFAULT_ERROR =
"\"default\" for link-type variables must include "\
"a single url, page, post, experience or accommodation value"

Instance Attribute Summary

Attributes inherited from Base

#attribute, #errors

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Canvas::Validator::SchemaAttribute::Base

Instance Method Details

#validateObject



13
14
15
16
17
# File 'lib/canvas/validators/schema_attributes/link.rb', line 13

def validate
  super &&
    ensure_single_default_provided &&
    ensure_default_key_is_valid
end