Sha256: ea3bf60b2728b286f1eeadb58000a62b9f69bf4b19406238febe24d5a617c45f

Contents?: true

Size: 331 Bytes

Versions: 43

Compression:

Stored size: 331 Bytes

Contents

Integer.class_eval do
  unless instance_methods.include?(:to_date)
    def to_date
      to_time.to_date
    end
  end
  
  unless instance_methods.include?(:to_datetime)
    def to_datetime
      to_time.to_datetime
    end
  end

  unless instance_methods.include?(:to_time)
    def to_time
      Time.at(self)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
active_remote-1.8.1 lib/active_remote/core_ext/integer.rb
active_remote-1.8.0 lib/active_remote/core_ext/integer.rb
active_remote-1.8.0.rc1 lib/active_remote/core_ext/integer.rb
active_remote-1.7.1 lib/active_remote/core_ext/integer.rb
active_remote-1.7.0 lib/active_remote/core_ext/integer.rb
active_remote-1.6.1 lib/core_ext/integer.rb
active_remote-1.6.0 lib/core_ext/integer.rb
active_remote-1.5.9 lib/core_ext/integer.rb
active_remote-1.5.8 lib/core_ext/integer.rb
active_remote-1.5.7 lib/core_ext/integer.rb
active_remote-1.5.6 lib/core_ext/integer.rb
active_remote-1.5.5 lib/core_ext/integer.rb
active_remote-1.5.4 lib/core_ext/integer.rb
active_remote-1.5.2 lib/core_ext/integer.rb
active_remote-1.5.1 lib/core_ext/integer.rb
active_remote-1.5.0 lib/core_ext/integer.rb
active_remote-1.4.1 lib/core_ext/integer.rb
active_remote-1.4.0 lib/core_ext/integer.rb
active_remote-1.3.3 lib/core_ext/integer.rb
active_remote-1.3.2 lib/core_ext/integer.rb