Module: Ago
- Defined in:
- lib/ago.rb,
lib/numbers.rb
Defined Under Namespace
Modules: Numbers, TimeAgo, VERSION
Constant Summary collapse
- Order =
[:year, :month, :week, :day, :hour, :minute, :second]
- Units =
{ :year => { :basic => 60 * 60 * 24 * 365, :gregorian => 86400 * 365.2425, }, :month => { :basic => 60 * 60 * 24 * 30, :gregorian => 86400 * 30.436875, }, :week => { :basic => 60 * 60 * 24 * 7, :gregorian => 86400 * 7.02389423076923, }, :day => { :basic => 60 * 60 * 24 }, :hour => { :basic => 60 * 60 }, :minute => { :basic => 60 }, :second => { :basic => 1 } }
Class Method Summary collapse
Class Method Details
.calendar_check(calendar) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/ago.rb', line 44 def Ago.calendar_check(calendar) error = ":calendar => value must be either :basic or :gregorian." unless calendar == :basic || calendar == :gregorian raise ArgumentError, error end end |