Class: BirdFeed::Feed

Inherits:
Object
  • Object
show all
Defined in:
lib/birdfeed/feed.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format) {|_self| ... } ⇒ Feed

Returns a new instance of Feed.

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
9
# File 'lib/birdfeed/feed.rb', line 5

def initialize(format, &block)
  @items = []
  @format = format
  yield self if block_given?
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def description
  @description
end

#itemsObject

Returns the value of attribute items.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def items
  @items
end

Returns the value of attribute link.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def link
  @link
end

#publisherObject

Returns the value of attribute publisher.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def publisher
  @publisher
end

#raw_contentObject

Returns the value of attribute raw_content.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def raw_content
  @raw_content
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def updated_at
  @updated_at
end

#xmlObject

Returns the value of attribute xml.



3
4
5
# File 'lib/birdfeed/feed.rb', line 3

def xml
  @xml
end

Class Method Details

.parse(content) ⇒ Object



12
13
14
# File 'lib/birdfeed/feed.rb', line 12

def parse(content)
  Format.detect(content).parse(content)
end