Class: Feed

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, link, description) ⇒ Feed

Returns a new instance of Feed.



12
13
14
15
16
17
# File 'lib/rss_parser.rb', line 12

def initialize(title, link, description)
  @title = title
  @link = link
  @description = description
  @items = []
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



10
11
12
# File 'lib/rss_parser.rb', line 10

def description
  @description
end

#generatorObject

Returns the value of attribute generator.



10
11
12
# File 'lib/rss_parser.rb', line 10

def generator
  @generator
end

#itemsObject

Returns the value of attribute items.



9
10
11
# File 'lib/rss_parser.rb', line 9

def items
  @items
end

#languageObject

Returns the value of attribute language.



10
11
12
# File 'lib/rss_parser.rb', line 10

def language
  @language
end

Returns the value of attribute link.



10
11
12
# File 'lib/rss_parser.rb', line 10

def link
  @link
end

#titleObject

Returns the value of attribute title.



10
11
12
# File 'lib/rss_parser.rb', line 10

def title
  @title
end

Instance Method Details

#item(params) ⇒ Object



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

def item(params)
  @items << OpenStruct.new(params)
end