Module: Humanized::UsesCalendar
- Defined in:
- lib/more/humanized/uses_calendar.rb
Class Method Summary collapse
Class Method Details
.extended(object) ⇒ Object
40 41 42 43 44 |
# File 'lib/more/humanized/uses_calendar.rb', line 40 def extended(object) included( (class << object; self; end) ) end |
.included(base) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/more/humanized/uses_calendar.rb', line 24 def included(base) raise ArgumentError, "You can only include UsesCalendar in a Humanizer" unless base <= Humanizer base.class_eval do component :calendar do |value, old| value || old || GregorianCalendar.new end end end |