Class: PointmdComments::Aggregators::Posts
- Inherits:
-
Object
- Object
- PointmdComments::Aggregators::Posts
- Defined in:
- lib/pointmd_comments/aggregators/posts.rb
Constant Summary collapse
- ALLOWED_SOURCES =
NOTE: This array may be populated with other website sections in the future.
%i[news today].freeze
- DEFAULT_SOURCE =
:news- MAIN_PAGE =
'https://point.md/ru/'.freeze
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source:, path:) ⇒ Posts
constructor
A new instance of Posts.
Constructor Details
#initialize(source:, path:) ⇒ Posts
Returns a new instance of Posts.
11 12 13 14 |
# File 'lib/pointmd_comments/aggregators/posts.rb', line 11 def initialize(source:, path:) @source = source @path = path end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
9 10 11 |
# File 'lib/pointmd_comments/aggregators/posts.rb', line 9 def source @source end |
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
9 10 11 |
# File 'lib/pointmd_comments/aggregators/posts.rb', line 9 def urls @urls end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/pointmd_comments/aggregators/posts.rb', line 16 def call validate_source fetch_posts puts "Found #{urls.count} links in the #{source} section.." @urls end |