Class: RingCentral::RSS::AtomFeed
- Inherits:
-
Object
- Object
- RingCentral::RSS::AtomFeed
- Defined in:
- lib/ringcentral-rss/atom_feed.rb
Instance Attribute Summary collapse
-
#feed ⇒ Object
Returns the value of attribute feed.
Instance Method Summary collapse
-
#initialize(response = nil, opts = {}) ⇒ AtomFeed
constructor
A new instance of AtomFeed.
- #load_message_store_response(response) ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(response = nil, opts = {}) ⇒ AtomFeed
Returns a new instance of AtomFeed.
8 9 10 11 12 13 14 15 16 |
# File 'lib/ringcentral-rss/atom_feed.rb', line 8 def initialize(response = nil, opts = {}) if opts.key?(:feed_name) && opts[:feed_name] @feed_name = opts[:feed_name] else @feed_name = 'RingCentral Feed' end @feed = nil (response) unless response.nil? end |
Instance Attribute Details
#feed ⇒ Object
Returns the value of attribute feed.
6 7 8 |
# File 'lib/ringcentral-rss/atom_feed.rb', line 6 def feed @feed end |
Instance Method Details
#load_message_store_response(response) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ringcentral-rss/atom_feed.rb', line 18 def (response) @feed = Atom::Feed.new do |f| f.title = @feed_name f.links << Atom::Link.new(href: "#{response.body['uri']}") f.updated = Time.parse("#{response.headers['date']}") response.body['records'].each do || f.entries << RingCentral::RSS::AtomEntry.new().entry end end end |
#to_xml ⇒ Object
29 30 31 |
# File 'lib/ringcentral-rss/atom_feed.rb', line 29 def to_xml (!@feed.nil? && @feed.is_a?(Atom::Feed)) ? @feed.to_xml : nil end |