Class: Date

Inherits:
Object show all
Defined in:
lib/gems/json_pure-1.1.3/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/gems/json_pure-1.1.3/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/gems/json_pure-1.1.3/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