Permalink
Browse files

Remove convertible

  • Loading branch information...
1 parent b49c86d commit a31816d86ad341962aa1019e08f5835daad87b8c @jnicklas jnicklas committed Jan 31, 2012
Showing with 10 additions and 18 deletions.
  1. +0 −1 lib/xpath.rb
  2. +0 −15 lib/xpath/convertible.rb
  3. +5 −1 lib/xpath/expression.rb
  4. +5 −1 lib/xpath/union.rb
View
@@ -3,7 +3,6 @@
module XPath
autoload :Expression, 'xpath/expression'
autoload :Literal, 'xpath/literal'
- autoload :Convertible, 'xpath/convertible'
autoload :Union, 'xpath/union'
autoload :Renderer, 'xpath/renderer'
autoload :HTML, 'xpath/html'
View
@@ -1,15 +0,0 @@
-module XPath
- module Convertible
- def to_s
- to_xpath
- end
-
- def to_xpaths
- [to_xpath]
- end
-
- def to_xpath
- Renderer.render(self)
- end
- end
-end
View
@@ -2,7 +2,6 @@ module XPath
class Expression
attr_accessor :expression, :arguments
include XPath::DSL::ExpressionLevel
- include Convertible
def initialize(expression, *arguments)
@expression = expression
@@ -12,5 +11,10 @@ def initialize(expression, *arguments)
def current
self
end
+
+ def to_xpath
+ Renderer.render(self)
+ end
+ alias_method :to_s, :to_xpath
end
end
View
@@ -1,7 +1,6 @@
module XPath
class Union
include Enumerable
- include Convertible
attr_reader :expressions
alias_method :arguments, :expressions
@@ -21,5 +20,10 @@ def each(&block)
def method_missing(*args)
XPath::Union.new(*arguments.map { |e| e.send(*args) })
end
+
+ def to_xpath
+ Renderer.render(self)
+ end
+ alias_method :to_s, :to_xpath
end
end

0 comments on commit a31816d

Please sign in to comment.