Class: OpdsMonster::Feed
- Inherits:
-
Object
- Object
- OpdsMonster::Feed
- Defined in:
- lib/opds_monster/feed.rb
Instance Attribute Summary collapse
-
#feed_items ⇒ Object
Returns the value of attribute feed_items.
-
#feed_url ⇒ Object
readonly
Returns the value of attribute feed_url.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #authentication_required? ⇒ Boolean
- #download_all_items ⇒ Object
-
#initialize(feed_url, options = {}) ⇒ Feed
constructor
A new instance of Feed.
- #items ⇒ Object
Constructor Details
#initialize(feed_url, options = {}) ⇒ Feed
Returns a new instance of Feed.
8 9 10 11 12 13 |
# File 'lib/opds_monster/feed.rb', line 8 def initialize(feed_url, = {}) @feed_url = feed_url @feed_items = [] @username = [:username] self.password = [:password] end |
Instance Attribute Details
#feed_items ⇒ Object
Returns the value of attribute feed_items.
4 5 6 |
# File 'lib/opds_monster/feed.rb', line 4 def feed_items @feed_items end |
#feed_url ⇒ Object (readonly)
Returns the value of attribute feed_url.
3 4 5 |
# File 'lib/opds_monster/feed.rb', line 3 def feed_url @feed_url end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/opds_monster/feed.rb', line 6 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/opds_monster/feed.rb', line 5 def username @username end |
Instance Method Details
#authentication_required? ⇒ Boolean
28 29 30 |
# File 'lib/opds_monster/feed.rb', line 28 def authentication_required? username.nil? end |
#download_all_items ⇒ Object
21 22 23 24 25 26 |
# File 'lib/opds_monster/feed.rb', line 21 def download_all_items items.each do |item| item.download(:username => username, :password => password) yield item, true end end |