rexle 0.2.13 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rexle.rb +7 -4
- metadata +1 -1
data/lib/rexle.rb
CHANGED
@@ -164,9 +164,13 @@ class Rexle
|
|
164
164
|
e = @child_elements[x.last]
|
165
165
|
h = x[0][1] # <-- fetch the attributes
|
166
166
|
|
167
|
-
if
|
168
|
-
|
169
|
-
|
167
|
+
if attr_search then
|
168
|
+
if attr_search.is_a? Fixnum then
|
169
|
+
block_given? ? blk.call(e) : e if i == attr_search
|
170
|
+
elsif h and eval(attr_search)
|
171
|
+
block_given? ? blk.call(e) : e
|
172
|
+
end
|
173
|
+
else
|
170
174
|
block_given? ? blk.call(e) : e
|
171
175
|
end
|
172
176
|
|
@@ -255,4 +259,3 @@ class Rexle
|
|
255
259
|
def count(path) @doc.xpath(path).flatten.compact.length end
|
256
260
|
|
257
261
|
end
|
258
|
-
|