Skip to content

Commit

Permalink
Remove convertible
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicklas committed Jan 31, 2012
1 parent b49c86d commit a31816d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
1 change: 0 additions & 1 deletion lib/xpath.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 0 additions & 15 deletions lib/xpath/convertible.rb

This file was deleted.

6 changes: 5 additions & 1 deletion lib/xpath/expression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module XPath
class Expression
attr_accessor :expression, :arguments
include XPath::DSL::ExpressionLevel
include Convertible

def initialize(expression, *arguments)
@expression = expression
Expand All @@ -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
6 changes: 5 additions & 1 deletion lib/xpath/union.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module XPath
class Union
include Enumerable
include Convertible

attr_reader :expressions
alias_method :arguments, :expressions
Expand All @@ -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.