Class: Stockboy::Translations::UKDate

Inherits:
Date show all
Includes:
Date::PatternMatching
Defined in:
lib/stockboy/translations/uk_date.rb

Overview

Translates numeric dates provided in UK (DMY) order

Priority is given to small-endian (UK) order:

  • DD-MM-YYYY

  • DD-MM-YY

  • DD/MM/YYYY

  • DD/MM/YY

Job template DSL

Registered as :uk_date. Use with:

attributes do
  check_in as: :uk_date
end

Examples:

date = Stockboy::Translator::UKDate.new

record.check_in = "1/2/12"
date.translate(record, :check_in) # => #<Date 2012-02-01>

Instance Attribute Summary

Attributes inherited from Stockboy::Translator

#field_key

Method Summary

Methods inherited from Date

#translate

Methods inherited from Stockboy::Translator

#call, #initialize, #inspect

Constructor Details

This class inherits a constructor from Stockboy::Translator