Sha256: 242283a80714e1ebdeaaf2acff32e5a72d4e9c8b630bfa6861e12ccb87232ea4
Contents?: true
Size: 479 Bytes
Versions: 14
Compression:
Stored size: 479 Bytes
Contents
module DataType class String < Base def initialize(options) super(options) @value ||= '' end def column if @value.match(/[\d,]+\.\d{2}$/) return Currency.new(@options).column else return @value.match(/[\r\n\t]/)? { :type => :text }.merge(@options) : super end end def mock @value || ((self.column[:type] == :text)? %W{Several lines of long text.}.join("\n") : "Some string") end end end
Version data entries
14 entries across 14 versions & 1 rubygems