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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



18
19
20
# File 'lib/avro/builder/dsl_attributes.rb', line 18

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#dsl_attribute?(name) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/avro/builder/dsl_attributes.rb', line 22

def dsl_attribute?(name)
  self.class.dsl_attribute_names.include?(name.to_sym)
end