In Files

  • json/lib/json/add/core.rb

Parent

Date

Public Class Methods

json_create(object) click to toggle source
 
               # File json/lib/json/add/core.rb, line 45
def self.json_create(object)
  civil(*object.values_at('y', 'm', 'd', 'sg'))
end
            

Public Instance Methods

to_json(*args) click to toggle source
 
               # File json/lib/json/add/core.rb, line 51
def to_json(*args)
  {
    JSON.create_id => self.class.name,
    'y' => year,
    'm' => month,
    'd' => day,
    'sg' => start,
  }.to_json(*args)
end