Class: GoogleDataSource::DataSource::DataDateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/google_data_source/data_date_time.rb

Instance Method Summary collapse

Constructor Details

#initialize(datetime) ⇒ DataDateTime

Returns a new instance of DataDateTime.



4
5
6
# File 'lib/google_data_source/data_date_time.rb', line 4

def initialize(datetime)
  @datetime = datetime
end

Instance Method Details

#as_json(options = nil) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/google_data_source/data_date_time.rb', line 8

def as_json(options=nil)
  if @datetime
    "Date(#{@datetime.year}, #{@datetime.month-1}, #{@datetime.day}, #{@datetime.hour}, #{@datetime.min}, #{@datetime.sec})"
  else
    nil
  end
end