Class: PRSS::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/prss/fetcher.rb

Constant Summary collapse

PERSONAL_FEED_URL =
"https://hdbits.org/rss/my"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(passkey) ⇒ Fetcher

Returns a new instance of Fetcher.



9
10
11
12
13
# File 'lib/prss/fetcher.rb', line 9

def initialize(passkey)
  #@passkey = passkey
  @uri = URI(PERSONAL_FEED_URL)
  @uri.query = "passkey=#{passkey}"
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



7
8
9
# File 'lib/prss/fetcher.rb', line 7

def uri
  @uri
end

Instance Method Details

#outputObject



19
20
21
# File 'lib/prss/fetcher.rb', line 19

def output
  response.body
end

#responseObject



15
16
17
# File 'lib/prss/fetcher.rb', line 15

def response
  @response ||= Typhoeus::Request.get(@uri.to_s)
end