Class: Strigil::CommentsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/strigil/comments_parser.rb

Class Method Summary collapse

Class Method Details

.parse(client) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/strigil/comments_parser.rb', line 3

def self.parse(client)
  comments = get_comments(client)

  comments.map do |comment|
    Strigil::Comment.new(
      author: get_author(comment),
      subreddit: get_subreddit(comment),
      permalink: get_permalink(comment),
      timestamp: get_timestamp(comment),
      text: get_text(comment)
    )
  end
end