Module: Virtus::Attribute::LazyDefault

Defined in:
lib/virtus/attribute/lazy_default.rb

Instance Method Summary collapse

Instance Method Details

#get(instance) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/virtus/attribute/lazy_default.rb', line 7

def get(instance)
  if instance.instance_variable_defined?(instance_variable_name)
    super
  else
    set_default_value(instance)
  end
end