Parent

Files

Date

Date serialization/deserialization

Public Class Methods

json_create(object) click to toggle source

Deserializes JSON string by converting Julian year y, month m, day d and Day of Calendar Reform sg to Date.

    # File lib/json/add/date.rb, line 11
11:   def self.json_create(object)
12:     civil(*object.values_at('y', 'm', 'd', 'sg'))
13:   end

Public Instance Methods

as_json(*) click to toggle source

Returns a hash, that will be turned into a JSON object and represent this object.

    # File lib/json/add/date.rb, line 19
19:   def as_json(*)
20:     {
21:       JSON.create_id => self.class.name,
22:       'y' => year,
23:       'm' => month,
24:       'd' => day,
25:       'sg' => start,
26:     }
27:   end
to_json(*args) click to toggle source

Stores class name (Date) with Julian year y, month m, day d and Day of Calendar Reform sg as JSON string

    # File lib/json/add/date.rb, line 31
31:   def to_json(*args)
32:     as_json.to_json(*args)
33:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.