Module: ArelExtensions::DateDuration

Included in:
Arel::Nodes::Equality, Arel::Nodes::Function, Arel::Nodes::Grouping, Attributes, Nodes::Case
Defined in:
lib/arel_extensions/date_duration.rb

Instance Method Summary collapse

Instance Method Details

#dayObject

function returns the month (as a number) given a date value.



24
25
26
# File 'lib/arel_extensions/date_duration.rb', line 24

def day
  ArelExtensions::Nodes::Duration.new 'd', self
end

#format(tpl, time_zone = nil) ⇒ Object



44
45
46
# File 'lib/arel_extensions/date_duration.rb', line 44

def format(tpl, time_zone = nil)
  ArelExtensions::Nodes::Format.new [self, tpl, time_zone]
end

#format_date(tpl, time_zone = nil) ⇒ Object



48
49
50
# File 'lib/arel_extensions/date_duration.rb', line 48

def format_date(tpl, time_zone = nil)
  ArelExtensions::Nodes::FormattedDate.new [self, tpl, time_zone]
end

#hourObject



32
33
34
# File 'lib/arel_extensions/date_duration.rb', line 32

def hour
  ArelExtensions::Nodes::Duration.new 'h', self
end

#minuteObject



36
37
38
# File 'lib/arel_extensions/date_duration.rb', line 36

def minute
  ArelExtensions::Nodes::Duration.new 'mn', self
end

#monthObject

function returns the month (as a number) given a date value.



14
15
16
# File 'lib/arel_extensions/date_duration.rb', line 14

def month
  ArelExtensions::Nodes::Duration.new 'm', self
end

#secondObject



40
41
42
# File 'lib/arel_extensions/date_duration.rb', line 40

def second
  ArelExtensions::Nodes::Duration.new 's', self
end

#wdayObject



28
29
30
# File 'lib/arel_extensions/date_duration.rb', line 28

def wday
  ArelExtensions::Nodes::Duration.new 'wd', self
end

#weekObject

function returns the week (as a number) given a date value.



19
20
21
# File 'lib/arel_extensions/date_duration.rb', line 19

def week
  ArelExtensions::Nodes::Duration.new 'w', self
end

#yearObject

function returns the year (as a number) given a date value.



9
10
11
# File 'lib/arel_extensions/date_duration.rb', line 9

def year
  ArelExtensions::Nodes::Duration.new 'y', self
end