Method: Dynamoid::Fields::Declare#call
- Defined in:
- lib/dynamoid/fields/declare.rb
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dynamoid/fields/declare.rb', line 14 def call # Register new field metadata @source.attributes = @source.attributes.merge( @name => { type: @type }.merge(@options) ) # Should be called before `define_attribute_methods` method because it # defines an attribute getter itself warn_about_method_overriding # Dirty API @source.define_attribute_method(@name) # Generate getters and setters as well as other helper methods generate_instance_methods # If alias name specified - generate the same instance methods if @options[:alias] generate_instance_methods_for_alias end end |