aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-07-19 12:58:01 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-07-19 12:58:01 +0000
commit42723e3a0c74e25c45c0f763740a3115302da4ac (patch)
treef01b1d6c055a6b3051945f2aa4c23268e2dc32f6 /activesupport/lib
parent83e2f6ae1e1d4c6863b7c0514d55d7641fbd7513 (diff)
downloadrails-42723e3a0c74e25c45c0f763740a3115302da4ac.tar.gz
rails-42723e3a0c74e25c45c0f763740a3115302da4ac.tar.bz2
rails-42723e3a0c74e25c45c0f763740a3115302da4ac.zip
Factor Fixnum and Bignum extensions into Integer class
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/fixnum.rb12
-rw-r--r--activesupport/lib/active_support/core_ext/integer.rb7
-rw-r--r--activesupport/lib/active_support/core_ext/integer/even_odd.rb (renamed from activesupport/lib/active_support/core_ext/fixnum/even_odd.rb)2
-rw-r--r--activesupport/lib/active_support/core_ext/integer/inflections.rb (renamed from activesupport/lib/active_support/core_ext/fixnum/inflections.rb)2
4 files changed, 9 insertions, 14 deletions
diff --git a/activesupport/lib/active_support/core_ext/fixnum.rb b/activesupport/lib/active_support/core_ext/fixnum.rb
deleted file mode 100644
index 519408fb0d..0000000000
--- a/activesupport/lib/active_support/core_ext/fixnum.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require File.dirname(__FILE__) + '/fixnum/even_odd'
-require File.dirname(__FILE__) + '/fixnum/inflections'
-
-class Fixnum #:nodoc:
- include ActiveSupport::CoreExtensions::Fixnum::EvenOdd
- include ActiveSupport::CoreExtensions::Fixnum::Inflections
-end
-
-class Bignum #:nodoc:
- include ActiveSupport::CoreExtensions::Fixnum::EvenOdd
- include ActiveSupport::CoreExtensions::Fixnum::Inflections
-end \ No newline at end of file
diff --git a/activesupport/lib/active_support/core_ext/integer.rb b/activesupport/lib/active_support/core_ext/integer.rb
new file mode 100644
index 0000000000..9346b88fd5
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/integer.rb
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/integer/even_odd'
+require File.dirname(__FILE__) + '/integer/inflections'
+
+class Integer #:nodoc:
+ include ActiveSupport::CoreExtensions::Integer::EvenOdd
+ include ActiveSupport::CoreExtensions::Integer::Inflections
+end
diff --git a/activesupport/lib/active_support/core_ext/fixnum/even_odd.rb b/activesupport/lib/active_support/core_ext/integer/even_odd.rb
index c0e9da18fa..3762308cc3 100644
--- a/activesupport/lib/active_support/core_ext/fixnum/even_odd.rb
+++ b/activesupport/lib/active_support/core_ext/integer/even_odd.rb
@@ -1,6 +1,6 @@
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
- module Fixnum #:nodoc:
+ module Integer #:nodoc:
# For checking if a fixnum is even or odd.
# * 1.even? # => false
# * 1.odd? # => true
diff --git a/activesupport/lib/active_support/core_ext/fixnum/inflections.rb b/activesupport/lib/active_support/core_ext/integer/inflections.rb
index 13c4f1130a..a86c4cc26c 100644
--- a/activesupport/lib/active_support/core_ext/fixnum/inflections.rb
+++ b/activesupport/lib/active_support/core_ext/integer/inflections.rb
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/../../inflector'
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
- module Fixnum #:nodoc:
+ module Integer #:nodoc:
module Inflections
# 1.ordinalize # => "1st"
# 3.ordinalize # => "3rd"