Class: DateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/firm/serializer/json.rb

Overview

fix flawed JSON serializing

Instance Method Summary collapse

Instance Method Details

#as_jsonObject



446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/firm/serializer/json.rb', line 446

def as_json(*)
  {
    JSON.create_id => self.class.name,
    'y' => year,
    'm' => month,
    'd' => day,
    'H' => hour,
    'M' => min,
    'S' => sec_fraction.to_f+sec,
    'of' => offset.to_s,
    'sg' => start,
  }
end