Class: Avromatic::Model::Configurable::FieldReference

Inherits:
Object
  • Object
show all
Defined in:
lib/avromatic/model/configurable.rb

Overview

Wraps a reference to a field so we can access both the string and symbolized versions of the name without repeated memory allocations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ FieldReference

Returns a new instance of FieldReference.



16
17
18
19
# File 'lib/avromatic/model/configurable.rb', line 16

def initialize(name)
  @name = -name
  @name_sym = name.to_sym
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/avromatic/model/configurable.rb', line 14

def name
  @name
end

#name_symObject (readonly)

Returns the value of attribute name_sym.



14
15
16
# File 'lib/avromatic/model/configurable.rb', line 14

def name_sym
  @name_sym
end