Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/clir/Date_utils.rb,
lib/clir/Integer.ext.rb

Overview

/class Time

Instance Method Summary collapse

Instance Method Details

#agoObject



152
153
154
# File 'lib/clir/Date_utils.rb', line 152

def ago
  (Time.now - self).mm_dd_yyyy
end

#heureObject Also known as: heures, hour, hours



31
32
33
# File 'lib/clir/Integer.ext.rb', line 31

def heure
  self * 3600
end

#in?(ary) ⇒ Boolean

Returns TRUE if self is inside ary or has key self.

Parameters:

Returns:

  • (Boolean)

    TRUE if self is inside ary or has key self



5
6
7
8
9
10
11
12
13
14
# File 'lib/clir/Integer.ext.rb', line 5

def in?(ary)
  case ary
  when Array, Range
    ary.include?(self)
  when Hash
    ary.key?(self)
  else
    raise "Integer#in? waits for a Array, an Hash or a Range. Given: #{ary.class}."
  end
end

#jourObject Also known as: jours, day, days

For 4.jours / 4.days



24
25
26
# File 'lib/clir/Integer.ext.rb', line 24

def jour
  self * 3600 * 24
end

#minuteObject Also known as: minutes



38
39
40
# File 'lib/clir/Integer.ext.rb', line 38

def minute
  self * 60
end

#semaineObject Also known as: semaines, week, weeks



16
17
18
# File 'lib/clir/Integer.ext.rb', line 16

def semaine
  self * 7  * 3600 * 24
end