Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/date.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) json_create(string)



10
11
12
13
# File 'lib/core_ext/date.rb', line 10

def self.json_create string
  return nil if string.nil?
  Date.parse(string)
end

Instance Method Details

- (Object) as_json(*args)



6
7
8
# File 'lib/core_ext/date.rb', line 6

def as_json(*args)
  strftime("%Y/%m/%d")
end

- (Object) to_json(*a)



2
3
4
# File 'lib/core_ext/date.rb', line 2

def to_json(*a)
  %("#{as_json}")
end