Class: Suma::LinkValidator::Step::Type
- Inherits:
-
Object
- Object
- Suma::LinkValidator::Step::Type
- Includes:
- Failure
- Defined in:
- lib/suma/link_validator/step.rb
Overview
Navigates one path segment from a Type by either enumeration value (for enum types) or by re-targeting to the underlying named type (for non-enum types).
Constant Summary collapse
- PRIMITIVE_TYPE_NAMES =
%w[INTEGER REAL STRING BOOLEAN NUMBER BINARY LOGICAL].freeze
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Failure
Class Method Details
.handles?(node) ⇒ Boolean
61 62 63 |
# File 'lib/suma/link_validator/step.rb', line 61 def self.handles?(node) node.is_a?(Expressir::Model::Declarations::Type) end |
Instance Method Details
#navigate(node, part, context) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/suma/link_validator/step.rb', line 65 def navigate(node, part, context) = node. unless return failure("Cannot navigate deeper from type '#{context.path}'", context) end if .is_a?(Expressir::Model::DataTypes::Enumeration) navigate_enum(, part, context) else (, context) end end |