D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
usr
/
share
/
ruby
/
json
/
add
/
Filename :
date.rb
back
Copy
#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end require 'date' class Date # Deserializes JSON string by converting Julian year <tt>y</tt>, month # <tt>m</tt>, day <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> to Date. def self.json_create(object) civil(*object.values_at('y', 'm', 'd', 'sg')) end alias start sg unless method_defined?(:start) # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'y' => year, 'm' => month, 'd' => day, 'sg' => start, } end # Stores class name (Date) with Julian year <tt>y</tt>, month <tt>m</tt>, day # <tt>d</tt> and Day of Calendar Reform <tt>sg</tt> as JSON string def to_json(*args) as_json.to_json(*args) end end
Name
Size
Last Modified
Owner
Permissions
Actions
bigdecimal.rb
0.584
KB
December 06 2024 2:24:35
root
0644
complex.rb
0.731
KB
December 06 2024 2:24:35
root
0644
core.rb
0.34
KB
December 06 2024 2:24:35
root
0644
date.rb
0.86
KB
December 06 2024 2:24:35
root
0644
date_time.rb
1.297
KB
December 06 2024 2:24:35
root
0644
exception.rb
0.78
KB
December 06 2024 2:24:35
root
0644
ostruct.rb
0.778
KB
December 06 2024 2:24:35
root
0644
range.rb
0.768
KB
December 06 2024 2:24:35
root
0644
rational.rb
0.762
KB
December 06 2024 2:24:35
root
0644
regexp.rb
0.742
KB
December 06 2024 2:24:35
root
0644
struct.rb
0.768
KB
December 06 2024 2:24:35
root
0644
symbol.rb
0.6
KB
December 06 2024 2:24:35
root
0644
time.rb
0.992
KB
December 06 2024 2:24:35
root
0644
2017 © D7net | D704T team