lib/viddl/video/clip/cut.rb
def duration(options = {})
          duration = nil
          if !options[:duration].nil? && !options[:end].nil?
            raise "Can not use both end time and duration"
          elsif !options[:duration].nil? && options[:end].nil?
            duration = options[:duration]
          elsif options[:duration].nil? && !options[:end].nil?
            duration = options[:end] - (options[:start] || 0)
          end
          duration
        end
# Numeric duration for the given options
# @param [Hash] options
# @option options [Numeric] :duration Duration of the clip
# @option options [Numeric] :end Time in the source file where the clip ends
# @return [Numeric]
Numeric duration for the given options
Numeric duration for the given options
def duration(options = {})
          duration = nil
          if !options[:duration].nil? && !options[:end].nil?
            raise "Can not use both end time and duration"
          elsif !options[:duration].nil? && options[:end].nil?
            duration = options[:duration]
          elsif options[:duration].nil? && !options[:end].nil?
            duration = options[:end] - (options[:start] || 0)
          end
          duration
        end
def duration ( options = { } ) duration = nil if ! options [ :duration ] . nil? && ! options [ :end ] . nil? raise "Can not use both end time and duration" elsif ! options [ :duration ] . nil? && options [ :end ] . nil? duration = options [ :duration ] elsif options [ :duration ] . nil? && ! options [ :end ] . nil? duration = options [ :end ] - ( options [ :start ] || 0 ) end duration end
Numeric duration for the given options
Numeric duration for the given options
None
Numeric
options
:end Time in the source file where the clip ends
: end Time in the source file where the clip ends
None