Class: Trio::Blog::API::PostReader
Instance Attribute Summary
#config, #document
Instance Method Summary
collapse
#initialize
Instance Method Details
#attributes ⇒ Object
9
10
11
|
# File 'lib/trio/blog/api/post_reader.rb', line 9
def attributes
@attributes ||= PostAttributes.new(selectors, document, config)
end
|
#selectors ⇒ Object
5
6
7
|
# File 'lib/trio/blog/api/post_reader.rb', line 5
def selectors
@selectors ||= PostSelectors.new(document, config)
end
|
#to_h ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/trio/blog/api/post_reader.rb', line 13
def to_h
{
title: attributes.title,
thumbnail_image_url: attributes.thumbnail_image_url,
post_url: attributes.post_url,
author: {
name: attributes.author_name,
avatar_image_url: attributes.author_avatar_image_url
}
}
end
|