lib/virtus/attribute/default_value.rb in virtus-0.4.0 vs lib/virtus/attribute/default_value.rb in virtus-0.4.1

- old
+ new

@@ -15,45 +15,35 @@ def self.build(*args) klass = descendants.detect { |descendant| descendant.handle?(*args) } || self klass.new(*args) end - # Returns the attribute associated with this default value instance - # - # @return [Virtus::Attribute::Object] - # - # @api private - attr_reader :attribute - # Returns the value instance # # @return [Object] # # @api private attr_reader :value # Initializes an default value instance # - # @param [Virtus::Attribute] attribute # @param [Object] value # # @return [undefined] # # @api private - def initialize(attribute, value) - @attribute, @value = attribute, value + def initialize(value) + @value = value end # Evaluates the value # - # @param [Object] - # # @return [Object] evaluated value # # @api private - def evaluate(instance) + def call(*) value end - end # class DefaultValue + end # class DefaultValue end # class Attribute end # module Virtus