Class: Feed

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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='', author='', date='', tags=[], link='', content='', imgs=[] )
    @title = title
    @author = author
    @date = date
    @tags = tags
    @link = link
    @content = content
    @imgs = imgs
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



5
6
7
# File 'lib/int_class/feed.rb', line 5

def author
  @author
end

#contentObject

Returns the value of attribute content.



5
6
7
# File 'lib/int_class/feed.rb', line 5

def content
  @content
end

#dateObject

Returns the value of attribute date.



5
6
7
# File 'lib/int_class/feed.rb', line 5

def date
  @date
end

#imgsObject

Returns the value of attribute imgs.



5
6
7
# File 'lib/int_class/feed.rb', line 5

def imgs
  @imgs
end

Returns the value of attribute link.



5
6
7
# File 'lib/int_class/feed.rb', line 5

def link
  @link
end

#tagsObject

Returns the value of attribute tags.



5
6
7
# File 'lib/int_class/feed.rb', line 5

def tags
  @tags
end

#titleObject

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_hashObject



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, @author, @date, @tags, @link, @content, @imgs]
  Hash[symbs.zip(values)]
end