Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/fluffy_barbarian/ext.rb

Instance Method Summary collapse

Instance Method Details

#to_s(style = nil) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/fluffy_barbarian/ext.rb', line 23

def to_s(style=nil)
  month_names = ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie']
  case style
  when :short
    "#{self.day} #{month_names[self.month-1]}"
  when :long
    "#{self.day} #{month_names[self.month-1]} #{self.year}"
  else
  end
end