hypermedia 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/api/document.rb +3 -3
- metadata +1 -1
data/lib/api/document.rb
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
class HypermediaAPI::Document
|
4
4
|
def entity (klass)
|
5
|
-
article = @document.
|
5
|
+
article = @document.at_css("article.#{klass.name.underscore}")
|
6
6
|
return nil unless article
|
7
7
|
|
8
|
-
klass.new_from_fields(article.
|
8
|
+
klass.new_from_fields(article.element_children.filter('code'))
|
9
9
|
end
|
10
10
|
|
11
11
|
def entities (klass)
|
12
12
|
articles = @document.css("article.#{klass.name.underscore}")
|
13
|
-
articles.map {|article| klass.new_from_fields(article.
|
13
|
+
articles.map {|article| klass.new_from_fields(article.element_children.filter('code')) }
|
14
14
|
end
|
15
15
|
|
16
16
|
def form (css_selector)
|