Module: Avro::Builder::DslAttributes
- Included in:
- DSL, Field, Types::Type
- Defined in:
- lib/avro/builder/dsl_attributes.rb
Overview
This module provides methods for defining attributes that can be set via the DSL on various objects.
The methods generated for DSL attributes are combined getter/setters of the form:
attribute(value = nil)
When a value is provided the attribute is set, and when it is nil the current value is returned.
When a DSL attribute is defined, the class also keeps track of the attribute names.
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- ATTRIBUTE_NAMES =
[ :abstract, :aliases, :default, :doc, :items, :logicalType, :logical_type, :namespace, :order, :precision, :scale, :size, :symbols, :type, :type_aliases, :type_doc, :type_name, :type_namespace, :types, :values ].freeze
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
43 44 45 |
# File 'lib/avro/builder/dsl_attributes.rb', line 43 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#dsl_attribute?(name) ⇒ Boolean
111 112 113 |
# File 'lib/avro/builder/dsl_attributes.rb', line 111 def dsl_attribute?(name) self.class.dsl_attribute_names.include?(name.to_sym) end |