module Schema::Normalize::ClassMethods
Public Instance Methods
create_schema_model_normalizer()
click to toggle source
# File lib/schema/normalize.rb, line 15 def create_schema_model_normalizer normalizer = ::Schema::ModelNormalizer.new schema_normalizations.each do |(attribute_name, method_name, options)| normalizer.add(attribute_name, method_name, options) end normalizer end
normalize(attribute_name, method_name, options = {})
click to toggle source
# File lib/schema/normalize.rb, line 27 def normalize(attribute_name, method_name, options = {}) new_value = schema_normalizations.dup << [attribute_name, method_name, options] redefine_class_method(:schema_normalizations, new_value) end
schema_model_normalizer()
click to toggle source
# File lib/schema/normalize.rb, line 23 def schema_model_normalizer @schema_model_normalizer ||= create_schema_model_normalizer end
schema_normalizations()
click to toggle source
# File lib/schema/normalize.rb, line 11 def schema_normalizations [].freeze end