class SellObject::Buscape::FormatterProxy

Public Instance Methods

preco(target_method) click to toggle source
# File lib/sell_object/buscape/formatter_proxy.rb, line 4
def preco(target_method)
        target_value = target.send target_method
        raise ArgumentError, "method expects a number, got #{target_value.class.name}: #{target_value}" unless target_value.is_a? Numeric 
        ('%.2f' % target_value).gsub '.', ','
end