123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::DateFormats

Relationships & Source Files
Defined in: activesupport/lib/active_support/date_formats.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

  • #list readonly Internal use only

Class Method Details

.lookup(format)

This method is for internal use only.
[ GitHub ]

  
# File 'activesupport/lib/active_support/date_formats.rb', line 24

def self.lookup(format) # :nodoc:
  @list[format] || DEPRECATED_LIST[format]
end

.register(name, format)

Registers a new date format for formatting ::Date instances. See Date::DATE_FORMATS for built-in formats. Use the format name as the name and either a strftime string or Proc instance that takes a date argument as the value.

[ GitHub ]

  
# File 'activesupport/lib/active_support/date_formats.rb', line 32

def self.register(name, format)
  @list = @list.merge(name => format).freeze
end

Instance Attribute Details

#list (readonly)

This method is for internal use only.
[ GitHub ]

  
# File 'activesupport/lib/active_support/date_formats.rb', line 20

singleton_class.attr_reader :list # :nodoc: