From 0d69486b7c4ab347133847589da282945b8b85c6 Mon Sep 17 00:00:00 2001
From: Vipul A M <vipulnsward@gmail.com>
Date: Sun, 31 May 2015 19:56:21 +0530
Subject: Move casted to its own file

---
 lib/arel/nodes.rb        | 41 +----------------------------------------
 lib/arel/nodes/casted.rb | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 40 deletions(-)
 create mode 100644 lib/arel/nodes/casted.rb

(limited to 'lib')

diff --git a/lib/arel/nodes.rb b/lib/arel/nodes.rb
index 7d900fe710..8d61bb320f 100644
--- a/lib/arel/nodes.rb
+++ b/lib/arel/nodes.rb
@@ -55,43 +55,4 @@ require 'arel/nodes/string_join'
 
 require 'arel/nodes/sql_literal'
 
-module Arel
-  module Nodes
-    class Casted < Arel::Nodes::Node # :nodoc:
-      attr_reader :val, :attribute
-      def initialize val, attribute
-        @val       = val
-        @attribute = attribute
-        super()
-      end
-
-      def nil?; @val.nil?; end
-
-      def eql? other
-        self.class == other.class &&
-          self.val == other.val &&
-          self.attribute == other.attribute
-      end
-      alias :== :eql?
-    end
-
-    class Quoted < Arel::Nodes::Unary # :nodoc:
-      alias :val :value
-      def nil?; val.nil?; end
-    end
-
-    def self.build_quoted other, attribute = nil
-      case other
-      when Arel::Nodes::Node, Arel::Attributes::Attribute, Arel::Table, Arel::Nodes::BindParam, Arel::SelectManager, Arel::Nodes::Quoted
-        other
-      else
-        case attribute
-        when Arel::Attributes::Attribute
-          Casted.new other, attribute
-        else
-          Quoted.new other
-        end
-      end
-    end
-  end
-end
+require 'arel/nodes/casted'
diff --git a/lib/arel/nodes/casted.rb b/lib/arel/nodes/casted.rb
new file mode 100644
index 0000000000..9fa02955ef
--- /dev/null
+++ b/lib/arel/nodes/casted.rb
@@ -0,0 +1,40 @@
+module Arel
+  module Nodes
+    class Casted < Arel::Nodes::Node # :nodoc:
+      attr_reader :val, :attribute
+      def initialize val, attribute
+        @val       = val
+        @attribute = attribute
+        super()
+      end
+
+      def nil?; @val.nil?; end
+
+      def eql? other
+        self.class == other.class &&
+            self.val == other.val &&
+            self.attribute == other.attribute
+      end
+      alias :== :eql?
+    end
+
+    class Quoted < Arel::Nodes::Unary # :nodoc:
+      alias :val :value
+      def nil?; val.nil?; end
+    end
+
+    def self.build_quoted other, attribute = nil
+      case other
+        when Arel::Nodes::Node, Arel::Attributes::Attribute, Arel::Table, Arel::Nodes::BindParam, Arel::SelectManager, Arel::Nodes::Quoted
+          other
+        else
+          case attribute
+            when Arel::Attributes::Attribute
+              Casted.new other, attribute
+            else
+              Quoted.new other
+          end
+      end
+    end
+  end
+end
-- 
cgit v1.2.3