Module: JSON::SchemaDsl::AstNode::ClassMethods
- Defined in:
- lib/json/schema_dsl/ast_node.rb
Overview
The class methods that ast nodes should have
Instance Method Summary collapse
-
#builder ⇒ Class
Override this to set a custom builder for your type.
-
#infer_type ⇒ String
(also: #type_method_name)
The type that will be used in I.E.
Instance Method Details
#builder ⇒ Class
Override this to set a custom builder for your type.
48 49 50 |
# File 'lib/json/schema_dsl/ast_node.rb', line 48 def builder ::JSON::SchemaDsl::Builder.define_builder(self) end |
#infer_type ⇒ String Also known as: type_method_name
Returns The type that will be used in I.E. ‘type: ’object’‘ attributes. Also used to give names to the dsl and builder methods.
37 38 39 40 |
# File 'lib/json/schema_dsl/ast_node.rb', line 37 def infer_type type = name.split('::').last.underscore type == 'entity' ? nil : type end |