Class: Trio::Blog::API::PostSelectors
Instance Attribute Summary
#config, #document
Instance Method Summary
collapse
#initialize
Instance Method Details
#author_avatar_image_element ⇒ Object
25
26
27
|
# File 'lib/trio/blog/api/post_selectors.rb', line 25
def author_avatar_image_element
post_element.css(config.author_avatar_image_url_selector).first || raise(SelectorNotFoundError.new(config.author_avatar_image_url_selector))
end
|
#author_name_element ⇒ Object
21
22
23
|
# File 'lib/trio/blog/api/post_selectors.rb', line 21
def author_name_element
post_element.css(config.author_name_selector).first || raise(SelectorNotFoundError.new(config.author_name_selector))
end
|
#post_element ⇒ Object
5
6
7
|
# File 'lib/trio/blog/api/post_selectors.rb', line 5
def post_element
document.css(config.post_selector).first || raise(SelectorNotFoundError.new(config.post_selector))
end
|
#post_link_element ⇒ Object
17
18
19
|
# File 'lib/trio/blog/api/post_selectors.rb', line 17
def post_link_element
post_element.css(config.post_url_selector).first || raise(SelectorNotFoundError.new(config.post_url_selector))
end
|
#thumbnail_image_element ⇒ Object
13
14
15
|
# File 'lib/trio/blog/api/post_selectors.rb', line 13
def thumbnail_image_element
post_element.css(config.thumbnail_image_url_selector).first || raise(SelectorNotFoundError.new(config.thumbnail_image_url_selector))
end
|
#title_element ⇒ Object
9
10
11
|
# File 'lib/trio/blog/api/post_selectors.rb', line 9
def title_element
post_element.css(config.title_selector).first || raise(SelectorNotFoundError.new(config.title_selector))
end
|