Skip to content
Browse files

remove ruby 1.8 related code

  • Loading branch information...
1 parent e154089 commit f54b8468c739055164aa8f51e9680c43a51c4381 @nashby nashby committed Jan 18, 2012
Showing with 0 additions and 15 deletions.
  1. +0 −15 activesupport/lib/active_support/core_ext/date_time/conversions.rb
15 activesupport/lib/active_support/core_ext/date_time/conversions.rb
@@ -58,32 +58,17 @@ def readable_inspect
alias_method :default_inspect, :inspect
alias_method :inspect, :readable_inspect
- # Converts self to a Ruby Date object; time portion is discarded.
- def to_date
-, month, day)
- end unless instance_methods(false).include?(:to_date)
# Attempts to convert self to a Ruby Time object; returns self if out of range of Ruby Time class.
# If self has an offset other than 0, self will just be returned unaltered, since there's no clean way to map it to a Time.
def to_time
self.offset == 0 ? ::Time.utc_time(year, month, day, hour, min, sec, sec_fraction * 1000000) : self
- # To be able to keep Times, Dates and DateTimes interchangeable on conversions.
- def to_datetime
- self
- end unless instance_methods(false).include?(:to_datetime)
def self.civil_from_format(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0)
offset = utc_or_local.to_sym == :local ? local_offset : 0
civil(year, month, day, hour, min, sec, offset)
- # Converts datetime to an appropriate format for use in XML.
- def xmlschema
- strftime("%Y-%m-%dT%H:%M:%S%Z")
- end unless instance_methods(false).include?(:xmlschema)
# Converts self to a floating-point number of seconds since the Unix epoch.
def to_f

0 comments on commit f54b846

Please sign in to comment.
Something went wrong with that request. Please try again.