Class: ISO8601::Minutes

Inherits:
Object
  • Object
show all
Includes:
Atomic
Defined in:
lib/iso8601/minutes.rb

Overview

The Minutes atom in a Duration

Constant Summary collapse

AVERAGE_FACTOR =
60

Instance Attribute Summary

Attributes included from Atomic

#atom

Instance Method Summary collapse

Methods included from Atomic

#<=>, #eql?, #hash, #to_f, #to_i, #to_s, #valid_atom?, #valid_base?, #value

Constructor Details

#initialize(atom) ⇒ Minutes

Returns a new instance of Minutes.

Parameters:

  • atom (Numeric)

    The atom value



13
14
15
16
17
# File 'lib/iso8601/minutes.rb', line 13

def initialize(atom)
  valid_atom?(atom)

  @atom = atom
end

Instance Method Details

#factorNumeric

The Minute factor

Returns:

  • (Numeric)


23
24
25
# File 'lib/iso8601/minutes.rb', line 23

def factor
  AVERAGE_FACTOR
end

#symbolSymbol

The atom symbol.

Returns:

  • (Symbol)


39
40
41
# File 'lib/iso8601/minutes.rb', line 39

def symbol
  :M
end

#to_secondsNumeric

The amount of seconds

Returns:

  • (Numeric)


31
32
33
# File 'lib/iso8601/minutes.rb', line 31

def to_seconds
  AVERAGE_FACTOR * atom
end