class Datev::DateField

Public Instance Methods

format() click to toggle source
# File lib/datev/field/date_field.rb, line 3
def format
  options[:format]
end
output(value, _context=nil) click to toggle source
# File lib/datev/field/date_field.rb, line 15
def output(value, _context=nil)
  value.strftime(format) if value
end
validate!(value) click to toggle source
Calls superclass method Datev::Field#validate!
# File lib/datev/field/date_field.rb, line 7
def validate!(value)
  super

  if value
    raise ArgumentError.new("Value given for field '#{name}' is not a Date or Time") unless value.is_a?(Time) || value.is_a?(Date)
  end
end