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



11
12
13
14
15
# File 'lib/iso8601/minutes.rb', line 11

def initialize(atom)
  valid_atom?(atom)

  @atom = atom
end

Instance Method Details

#factorNumeric

The Minute factor

Returns:

  • (Numeric)


21
22
23
# File 'lib/iso8601/minutes.rb', line 21

def factor
  AVERAGE_FACTOR
end

#symbolSymbol

The atom symbol.

Returns:

  • (Symbol)


37
38
39
# File 'lib/iso8601/minutes.rb', line 37

def symbol
  :M
end

#to_secondsNumeric

The amount of seconds

Returns:

  • (Numeric)


29
30
31
# File 'lib/iso8601/minutes.rb', line 29

def to_seconds
  AVERAGE_FACTOR * atom
end