Class: Bluepine::Attributes::Visitor Abstract
- Inherits:
-
Object
- Object
- Bluepine::Attributes::Visitor
- Includes:
- Functions
- Defined in:
- lib/bluepine/attributes/visitor.rb
Overview
Direct Known Subclasses
Generators::OpenAPI::PropertyGenerator, Serializer, Validator
Constant Summary collapse
Instance Method Summary collapse
-
#visit(attribute, *args) ⇒ Object
Traveres a visitable object and calls corresponding method based-on sub-classes’ impementations.
-
#visit_attribute(attribute, options = {}) ⇒ Object
Performs visitor logic when no corresponding method can be found (Catch-all).
- #visit_schema(attribute, options = {}) ⇒ Object
Methods included from Functions
#compose, #compose_result, #curry, #result
Instance Method Details
#visit(attribute, *args) ⇒ Object
Traveres a visitable object and calls corresponding method based-on sub-classes’ impementations.
36 37 38 39 40 |
# File 'lib/bluepine/attributes/visitor.rb', line 36 def visit(attribute, *args) method, attribute = find_method!(attribute, *args) send(method, attribute, *args) end |
#visit_attribute(attribute, options = {}) ⇒ Object
Performs visitor logic when no corresponding method can be found (Catch-all).
43 44 45 |
# File 'lib/bluepine/attributes/visitor.rb', line 43 def visit_attribute(attribute, = {}) raise NotImplementedError end |
#visit_schema(attribute, options = {}) ⇒ Object
47 48 49 |
# File 'lib/bluepine/attributes/visitor.rb', line 47 def visit_schema(attribute, = {}) raise NotImplementedError end |