Class: Popularity::RedditResult

Inherits:
RedditPost show all
Defined in:
lib/popularity/networks/reddit_post.rb

Instance Attribute Summary

Attributes inherited from Crawler

#url

Instance Method Summary collapse

Methods inherited from RedditPost

#comments, #name, #score

Methods inherited from Crawler

#as_json, #async_done?, #host, #name, property_names, #request_url, #response, #response_json, stats, #total

Constructor Details

#initialize(url, r) ⇒ RedditResult

Returns a new instance of RedditResult.



45
46
47
48
49
50
51
# File 'lib/popularity/networks/reddit_post.rb', line 45

def initialize(url, r)
  super(url)
  @url = url
  @response = r

  self
end

Instance Method Details

#fetchObject



65
66
67
# File 'lib/popularity/networks/reddit_post.rb', line 65

def fetch
  false
end

#fetch_asyncObject



69
70
71
# File 'lib/popularity/networks/reddit_post.rb', line 69

def fetch_async
  false
end

#has_response?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/popularity/networks/reddit_post.rb', line 53

def has_response?
  true
end

#reddit_urlObject



57
58
59
# File 'lib/popularity/networks/reddit_post.rb', line 57

def reddit_url
  @url
end

#valid?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/popularity/networks/reddit_post.rb', line 61

def valid?
  URI.parse(@url).host
end