class Time

Public Instance Methods

_stampa(*args) click to toggle source

Rappresentazione per stampa.

# File lib/italian/ruby/metodi/time.rb, line 71
def _stampa(*args)
  "#{in_data.formatta "%d %B %Y"} #{strftime "%H:%M:%S %z"}".arancione
end
alle(ore, minuti = 0, secondi = 0) click to toggle source

Sposta il tempo alle ore specificate.

# File lib/italian/ruby/metodi/time.rb, line 29
def alle(ore, minuti = 0, secondi = 0)
  Time.new(self.year, self.month, self.day, ore, minuti, secondi)
end
fine_giorno() click to toggle source

Ritorna il tempo alla fine del giorno.

# File lib/italian/ruby/metodi/time.rb, line 41
def fine_giorno
  Time.new(self.year, self.month, self.day, 23, 59, 59)
end
fine_minuto() click to toggle source

Ritorna il tempo alla fine del minuto.

# File lib/italian/ruby/metodi/time.rb, line 65
def fine_minuto
  Time.new(self.year, self.month, self.day, self.hour, self.min, 59)
end
fine_ora() click to toggle source

Ritorna il tempo alla fine dell'ora.

# File lib/italian/ruby/metodi/time.rb, line 53
def fine_ora
  Time.new(self.year, self.month, self.day, self.hour, 59, 59)
end
formatta(format)
Alias for: formatta_locale
formatta_locale(format) click to toggle source

Formatta il tempo secondo la stringa passata.

# File lib/italian/ruby/metodi/time.rb, line 19
def formatta_locale(format)
  if defined? I18n
    I18n.l self, format: format
  else
    strftime format
  end
end
Also aliased as: formatta
in_data() click to toggle source

Converte il tempo in data.

# File lib/italian/ruby/metodi/time.rb, line 7
def in_data
  self.to_date
end
in_tempo() click to toggle source

Converte il tempo in se stesso.

# File lib/italian/ruby/metodi/time.rb, line 13
def in_tempo
  self
end
inizio_giorno() click to toggle source

Ritorna il tempo all'inizio del giorno.

# File lib/italian/ruby/metodi/time.rb, line 35
def inizio_giorno
  Time.new(self.year, self.month, self.day)
end
inizio_minuto() click to toggle source

Ritorna il tempo all'inizio del minuto.

# File lib/italian/ruby/metodi/time.rb, line 59
def inizio_minuto
  Time.new(self.year, self.month, self.day, self.hour, self.min)
end
inizio_ora() click to toggle source

Ritorna il tempo all'inizio dell'ora.

# File lib/italian/ruby/metodi/time.rb, line 47
def inizio_ora
  Time.new(self.year, self.month, self.day, self.hour)
end