class Numeric
def as_json(options = nil) # :nodoc:
def as_json(options = nil) # :nodoc: self end
def blank?
-
(false)
-
def blank? false end
def bytes
Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
def bytes self end
def days
Returns a Duration instance matching the number of days provided.
def days ActiveSupport::Duration.days(self) end
def exabytes
Returns the number of bytes equivalent to the exabytes provided.
def exabytes self * EXABYTE end
def fortnights
Returns a Duration instance matching the number of fortnights provided.
def fortnights ActiveSupport::Duration.weeks(self * 2) end
def gigabytes
Returns the number of bytes equivalent to the gigabytes provided.
def gigabytes self * GIGABYTE end
def hours
Returns a Duration instance matching the number of hours provided.
def hours ActiveSupport::Duration.hours(self) end
def html_safe?
def html_safe? true end
def in_milliseconds
2.in_milliseconds # => 2000
Used with the standard time durations.
Returns the number of milliseconds equivalent to the seconds provided.
def in_milliseconds self * 1000 end
def kilobytes
Returns the number of bytes equivalent to the kilobytes provided.
def kilobytes self * KILOBYTE end
def megabytes
Returns the number of bytes equivalent to the megabytes provided.
def megabytes self * MEGABYTE end
def minutes
Returns a Duration instance matching the number of minutes provided.
def minutes ActiveSupport::Duration.minutes(self) end
def petabytes
Returns the number of bytes equivalent to the petabytes provided.
def petabytes self * PETABYTE end
def seconds
Returns a Duration instance matching the number of seconds provided.
def seconds ActiveSupport::Duration.seconds(self) end
def terabytes
Returns the number of bytes equivalent to the terabytes provided.
def terabytes self * TERABYTE end
def weeks
Returns a Duration instance matching the number of weeks provided.
def weeks ActiveSupport::Duration.weeks(self) end