Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove convertible

  • Loading branch information...
commit a31816d86ad341962aa1019e08f5835daad87b8c 1 parent b49c86d
@jnicklas authored
View
1  lib/xpath.rb
@@ -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
15 lib/xpath/convertible.rb
@@ -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
6 lib/xpath/expression.rb
@@ -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
6 lib/xpath/union.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.