Sha256: b47d94af7bdd89de064a3dd9d1ffb04f87d7aae2fcfd831bb6f2e035b107e8dd

Contents?: true

Size: 243 Bytes

Versions: 5

Compression:

Stored size: 243 Bytes

Contents

module Hobo
  
  class Percentage < DelegateClass(Fixnum)
    
    COLUMN_TYPE = :integer
    
    def validate
      "must be from 0 to 100" unless self.in?(0..100)
    end
        
  end

end
Hobo.field_types[:percentage] = Hobo::Percentage

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hobo-0.7.0 hobo_files/plugin/lib/hobo/percentage.rb
hobo-0.6.3 hobo_files/plugin/lib/hobo/percentage.rb
hobo-0.6.4 hobo_files/plugin/lib/hobo/percentage.rb
hobo-0.7.1 hobo_files/plugin/lib/hobo/percentage.rb
hobo-0.7.2 hobo_files/plugin/lib/hobo/percentage.rb