Class: PRSS::Fetcher
- Inherits:
-
Object
- Object
- PRSS::Fetcher
- Defined in:
- lib/prss/fetcher.rb
Constant Summary collapse
- PERSONAL_FEED_URL =
"https://hdbits.org/rss/my"
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(passkey) ⇒ Fetcher
constructor
A new instance of Fetcher.
- #output ⇒ Object
- #response ⇒ Object
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
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
7 8 9 |
# File 'lib/prss/fetcher.rb', line 7 def uri @uri end |
Instance Method Details
#output ⇒ Object
19 20 21 |
# File 'lib/prss/fetcher.rb', line 19 def output response.body end |
#response ⇒ Object
15 16 17 |
# File 'lib/prss/fetcher.rb', line 15 def response @response ||= Typhoeus::Request.get(@uri.to_s) end |