class Virtus::AttributeSet

patch Virtus to not serialize unset lazy attributes

Public Instance Methods

get(object) click to toggle source
# File lib/skala.rb, line 31
def get(object)
  each_with_object({}) do |attribute, attributes|
    name = attribute.name

    if attribute.public_reader? && (!attribute.lazy? || attribute.defined?(object))
      attributes[name] = object.__send__(name)
    end
  end
end