Kiss A simpler, smarter web application framework for Ruby

Kiss::Format Subclass of Object

Description

This class is used to validate and parse strings into Sequel-ready values.

Attributes

defaultwritable

Not documented

errorwritable

Not documented

input_widthwritable

Not documented

legendwritable

Not documented

regexpwritable

Not documented

Public Class Methods

inherited(subclass) source

copy Format class instance variables to their subclasses

    # File lib/kiss/format.rb, line 17
      def inherited(subclass)
        self.instance_variables.each do |var|
          subclass.instance_variable_set(var, instance_variable_get(var))
        end
      end
    
lookup(format) source

Not documented

    # File lib/kiss/format.rb, line 209
    def self.lookup(format)
      format = format.to_sym if format.is_a?(String)
      format.is_a?(Symbol) ?
        # if symbol, lookup format by symbol
        @@symbols[format] || self :
        # else return format, or Kiss::Format if format not defined
        format || self
    end
    
parse(value) source

Not documented

    # File lib/kiss/format.rb, line 23
      def parse(value)
        value
      end
    
validate(value) source

Not documented

    # File lib/kiss/format.rb, line 31
      def validate(value)
        raise Kiss::Format::ValidateError, @error unless value.to_s =~ @regexp
        parse(value)
      end
    
value_to_s(value) source

Not documented

    # File lib/kiss/format.rb, line 27
      def value_to_s(value)
        value.to_s
      end
    

Disabled; run with $DEBUG to generate this.