Class: Article

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeArticle

Returns a new instance of Article.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/zhSieve/article.rb', line 4

def initialize
	@author = 'NA'
	@bio = 'NA'
	@avatar = 'NA'
	@link = 'NA'
	@content = 'NA'
	@author_link = 'NA'
	@title = 'NA'
	@title_image = 'NA'
	@published_time = 'NA'
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def author
  @author
end

Returns the value of attribute author_link.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def author_link
  @author_link
end

#avatarObject

Returns the value of attribute avatar.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def avatar
  @avatar
end

#bioObject

Returns the value of attribute bio.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def bio
  @bio
end

#contentObject

Returns the value of attribute content.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def content
  @content
end

Returns the value of attribute link.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def link
  @link
end

#published_timeObject

Returns the value of attribute published_time.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def published_time
  @published_time
end

#titleObject

Returns the value of attribute title.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def title
  @title
end

#title_imageObject

Returns the value of attribute title_image.



2
3
4
# File 'lib/zhSieve/article.rb', line 2

def title_image
  @title_image
end

Instance Method Details

#format_markdownObject



16
17
18
19
20
21
22
23
24
# File 'lib/zhSieve/article.rb', line 16

def format_markdown
	res_file = "## [#{@title}](#{@link})" + "\n"
	res_file += "### "+@avatar + "[#{@author}](" + @author_link + ")"  + "\n"
	res_file += "#### "+ @bio + "\n"
	res_file += "*****\n"
	res_file += @title_image
	res_file += @content
	res_file
end