Class: Stockboy::Translations::USDate

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

Overview

Translates numeric dates provided in US (MDY) order

Priority is given to middle-endian (US) order:

  • MM-DD-YYYY

  • MM-DD-YY

  • MM/DD/YYYY

  • MM/DD/YY

Job template DSL

Registered as :us_date. Use with:

attributes do
  check_in as: :us_date
end

Examples:

date = Stockboy::Translator::USDate.new

record.check_in = "2-1-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