Sha256: 03b8987503e31ecc18946ba79178de26781e02db29b18d0272a6a2fb7730fce4

Contents?: true

Size: 316 Bytes

Versions: 27

Compression:

Stored size: 316 Bytes

Contents

module Virtus
  class Attribute

    module LazyDefault

      # @api public
      def get(instance)
        if instance.instance_variable_defined?(instance_variable_name)
          super
        else
          set_default_value(instance)
        end
      end

    end # LazyDefault

  end # Attribute
end # Virtus

Version data entries

27 entries across 25 versions & 5 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/lib/virtus/attribute/lazy_default.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/lib/virtus/attribute/lazy_default.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/lib/virtus/attribute/lazy_default.rb
virtus2-2.1.0 lib/virtus/attribute/lazy_default.rb
virtus2-2.0.2 lib/virtus/attribute/lazy_default.rb
virtus2-2.0.1 lib/virtus/attribute/lazy_default.rb
virtus-2.0.0 lib/virtus/attribute/lazy_default.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/virtus-1.0.5/lib/virtus/attribute/lazy_default.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/virtus-1.0.5/lib/virtus/attribute/lazy_default.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/attribute/lazy_default.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/attribute/lazy_default.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/attribute/lazy_default.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/attribute/lazy_default.rb
virtus-1.0.5 lib/virtus/attribute/lazy_default.rb
virtus-1.0.4 lib/virtus/attribute/lazy_default.rb
virtus-1.0.3 lib/virtus/attribute/lazy_default.rb
virtus-1.0.2 lib/virtus/attribute/lazy_default.rb
virtus-1.0.1 lib/virtus/attribute/lazy_default.rb
virtus-1.0.0 lib/virtus/attribute/lazy_default.rb
virtus-1.0.0.rc2 lib/virtus/attribute/lazy_default.rb