class Timespan::TimeDuration

Attributes

duration[R]
reverse[R]

Public Class Methods

create_reverse(duration) click to toggle source
# File lib/timespan/compare.rb, line 16
def self.create_reverse duration
  self.new duration, :reverse => true
end
new(duration, options = {}) click to toggle source
# File lib/timespan/compare.rb, line 7
def initialize duration, options = {}
  @duration = ::Duration.new(duration)
  @reverse = options[:reverse] || (@duration.total < 0)
end

Public Instance Methods

total() click to toggle source
# File lib/timespan/compare.rb, line 12
def total
  reverse ? -(duration.total.abs) : duration.total
end