module FastSerializer::Schema::Mixin::ClassMethods

Attributes

__patched__[RW]
__schema__[RW]

Public Instance Methods

__patch_with_attribute_definition() click to toggle source
# File lib/fast_serializer/schema/mixin.rb, line 25
def __patch_with_attribute_definition
  injectable_attributes = __schema__.serialization_schema.attributes.select { |_key, attribute| attribute.injectable? }
  injectable_attributes.each { |_, attribute| attribute.inject(self) }
  self.__patched__ = true

  __patched__.freeze
end
inherited(subclass) click to toggle source
# File lib/fast_serializer/schema/mixin.rb, line 9
def inherited(subclass)
  subclass.__schema__ = __schema__.deep_copy
end
method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/fast_serializer/schema/mixin.rb, line 13
def method_missing(method, *args, &block)
  if __schema__.respond_to?(method)
    __schema__.public_send(method, *args, &block)
  else
    super
  end
end
respond_to_missing?(method_name, include_private = false) click to toggle source
Calls superclass method
# File lib/fast_serializer/schema/mixin.rb, line 21
def respond_to_missing?(method_name, include_private = false)
  __schema__.respond_to?(method_name) || super
end