Class: Date

Inherits:
Object show all
Defined in:
lib/crazy_ivan/vendor/json-1.1.7/lib/json/add/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(object) ⇒ Object



32
33
34
# File 'lib/crazy_ivan/vendor/json-1.1.7/lib/json/add/core.rb', line 32

def self.json_create(object)
  civil(*object.values_at('y', 'm', 'd', 'sg'))
end

Instance Method Details

#to_json(*args) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/crazy_ivan/vendor/json-1.1.7/lib/json/add/core.rb', line 38

def to_json(*args)
  {
    'json_class' => self.class.name,
    'y' => year,
    'm' => month,
    'd' => day,
    'sg' => start,
  }.to_json(*args)
end