1
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
6
# Date serialization/deserialization
9
# Deserializes JSON string by converting Julian year <tt>y</tt>, month
10
# <tt>m</tt>, day <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> to Date.
11
def self.json_create(object)
12
civil(*object.values_at('y', 'm', 'd', 'sg'))
15
alias start sg unless method_defined?(:start)
17
# Returns a hash, that will be turned into a JSON object and represent this
21
JSON.create_id => self.class.name,
29
# Stores class name (Date) with Julian year <tt>y</tt>, month <tt>m</tt>, day
30
# <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string
32
as_json.to_json(*args)