Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/clir/Date_utils.rb,
lib/clir/Integer.ext.rb
Overview
/class Time
Instance Method Summary collapse
- #ago ⇒ Object
- #heure ⇒ Object (also: #heures, #hour, #hours)
-
#in?(ary) ⇒ Boolean
TRUE if self is inside
ary
or has key self. -
#jour ⇒ Object
(also: #jours, #day, #days)
For 4.jours / 4.days.
- #minute ⇒ Object (also: #minutes)
- #semaine ⇒ Object (also: #semaines, #week, #weeks)
Instance Method Details
#ago ⇒ Object
152 153 154 |
# File 'lib/clir/Date_utils.rb', line 152 def ago (Time.now - self).mm_dd_yyyy end |
#heure ⇒ Object 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.
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 |
#jour ⇒ Object 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 |
#minute ⇒ Object Also known as: minutes
38 39 40 |
# File 'lib/clir/Integer.ext.rb', line 38 def minute self * 60 end |
#semaine ⇒ Object Also known as: semaines, week, weeks
16 17 18 |
# File 'lib/clir/Integer.ext.rb', line 16 def semaine self * 7 * 3600 * 24 end |