Class: DateTime
- Inherits:
-
Object
- Object
- DateTime
- Defined in:
- lib/jinx/json/date.rb
Class Method Summary collapse
-
.json_create(json) ⇒ Date
The deserialized object.
Instance Method Summary collapse
-
#to_json(*args) ⇒ String
Adds JSON serialization to Ruby Date.
Class Method Details
.json_create(json) ⇒ Date
Returns the deserialized object.
7 8 9 |
# File 'lib/jinx/json/date.rb', line 7 def self.json_create(json) parse(json['data']) end |
Instance Method Details
#to_json(*args) ⇒ String
Adds JSON serialization to Ruby Date.
15 16 17 18 19 20 |
# File 'lib/jinx/json/date.rb', line 15 def to_json(*args) { 'json_class' => self.class.name, 'data' => to_s }.to_json(*args) end |