Parent

Class Index [+]

Quicksearch

DateTime

Public Class Methods

json_create(object) click to toggle source
    # File lib/json/add/core.rb, line 63
63:   def self.json_create(object)
64:     args = object.values_at('y', 'm', 'd', 'H', 'M', 'S')
65:     of_a, of_b = object['of'].split('/')
66:     if of_b and of_b != '0'
67:       args << Rational(of_a.to_i, of_b.to_i)
68:     else
69:       args << of_a
70:     end
71:     args << object['sg']
72:     civil(*args)
73:   end

Public Instance Methods

to_json(*args) click to toggle source
    # File lib/json/add/core.rb, line 77
77:   def to_json(*args)
78:     {
79:       JSON.create_id => self.class.name,
80:       'y' => year,
81:       'm' => month,
82:       'd' => day,
83:       'H' => hour,
84:       'M' => min,
85:       'S' => sec,
86:       'of' => offset.to_s,
87:       'sg' => start,
88:     }.to_json(*args)
89:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.