Class: Feed
- Inherits:
-
Object
- Object
- Feed
- Defined in:
- lib/int_class/feed.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#content ⇒ Object
Returns the value of attribute content.
-
#date ⇒ Object
Returns the value of attribute date.
-
#imgs ⇒ Object
Returns the value of attribute imgs.
-
#link ⇒ Object
Returns the value of attribute link.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title = '', author = '', date = '', tags = [], link = '', content = '', imgs = []) ⇒ Feed
constructor
A new instance of Feed.
- #to_hash ⇒ Object
Constructor Details
#initialize(title = '', author = '', date = '', tags = [], link = '', content = '', imgs = []) ⇒ Feed
Returns a new instance of Feed.
7 8 9 10 11 12 13 14 15 |
# File 'lib/int_class/feed.rb', line 7 def initialize( title='', ='', date='', =[], link='', content='', imgs=[] ) @title = title = @date = date = @link = link @content = content @imgs = imgs end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
5 6 7 |
# File 'lib/int_class/feed.rb', line 5 def end |
#content ⇒ Object
Returns the value of attribute content.
5 6 7 |
# File 'lib/int_class/feed.rb', line 5 def content @content end |
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/int_class/feed.rb', line 5 def date @date end |
#imgs ⇒ Object
Returns the value of attribute imgs.
5 6 7 |
# File 'lib/int_class/feed.rb', line 5 def imgs @imgs end |
#link ⇒ Object
Returns the value of attribute link.
5 6 7 |
# File 'lib/int_class/feed.rb', line 5 def link @link end |
#tags ⇒ Object
Returns the value of attribute tags.
5 6 7 |
# File 'lib/int_class/feed.rb', line 5 def end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/int_class/feed.rb', line 5 def title @title end |
Instance Method Details
#to_hash ⇒ Object
17 18 19 20 21 |
# File 'lib/int_class/feed.rb', line 17 def to_hash() symbs = %w(title author date tags link content imgs) values = [@title, , @date, , @link, @content, @imgs] Hash[symbs.zip(values)] end |