Sha256: b19b4298f12ca6c9e3ab34c7566758360bdd4295eee98d0e359b99d133a7fc50
Contents?: true
Size: 1.02 KB
Versions: 7
Compression:
Stored size: 1.02 KB
Contents
module Virtus class Attribute # Class representing the default value option # # @api private class DefaultValue extend DescendantsTracker include Equalizer.new(inspect) << :value # Builds a default value instance # # @return [Virtus::Attribute::DefaultValue] # # @api private def self.build(*args) klass = descendants.detect { |descendant| descendant.handle?(*args) } || self klass.new(*args) end # Returns the value instance # # @return [Object] # # @api private attr_reader :value # Initializes an default value instance # # @param [Object] value # # @return [undefined] # # @api private def initialize(value) @value = value end # Evaluates the value # # @return [Object] evaluated value # # @api private def call(*) value end end # class DefaultValue end # class Attribute end # module Virtus
Version data entries
7 entries across 7 versions & 3 rubygems