Sha256: f4641a11ff3a72dd1ffc8c788a75a720ea6bda1de5c63e16d0a97a3fbc3ef28c
Contents?: true
Size: 920 Bytes
Versions: 9
Compression:
Stored size: 920 Bytes
Contents
module Virtus class Attribute class DefaultValue # Represents default value evaluated via a clonable object # # @api private class FromClonable < DefaultValue SINGLETON_CLASSES = [ ::NilClass, ::TrueClass, ::FalseClass, ::Numeric, ::Symbol ].freeze # Return if the class can handle the value # # @param [Object] value # # @return [Boolean] # # @api private def self.handle?(value) case value when *SINGLETON_CLASSES false else true end end # Evaluates the value via value#clone # # @return [Object] evaluated value # # @api private def call(*) @value.clone end end # class FromClonable end # class DefaultValue end # class Attribute end # module Virtus
Version data entries
9 entries across 9 versions & 2 rubygems