Class: Evertils::Common::Query::Base

Inherits:
Generic
  • Object
show all
Defined in:
lib/evertils/common/query.rb

Overview

Since:

  • 0.3.0

Direct Known Subclasses

Backup, Simple, Time

Instance Method Summary collapse

Methods inherited from Generic

#bytesize, #deprecation_notice, #encoding, #force_encoding, #has_required_fields, #initialize

Constructor Details

This class inherits a constructor from Evertils::Common::Generic

Instance Method Details

#end_of_day(date = nil) ⇒ Object

Since:

  • 0.2.8



15
16
17
18
19
# File 'lib/evertils/common/query.rb', line 15

def end_of_day(date = nil)
  date = ::Time.now unless date

  ::Time.mktime(date.year, date.month, date.day, 23, 59, 59).to_datetime
end

#start_of_day(date = nil) ⇒ Object

Since:

  • 0.2.8



7
8
9
10
11
# File 'lib/evertils/common/query.rb', line 7

def start_of_day(date = nil)
  date = ::Time.now unless date

  ::Time.mktime(date.year, date.month, date.day, 12, 0, 0).to_datetime
end