Class: Article
- Inherits:
-
Object
- Object
- Article
- Defined in:
- lib/zhSieve/article.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#author_link ⇒ Object
Returns the value of attribute author_link.
-
#avatar ⇒ Object
Returns the value of attribute avatar.
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#content ⇒ Object
Returns the value of attribute content.
-
#link ⇒ Object
Returns the value of attribute link.
-
#published_time ⇒ Object
Returns the value of attribute published_time.
-
#title ⇒ Object
Returns the value of attribute title.
-
#title_image ⇒ Object
Returns the value of attribute title_image.
Instance Method Summary collapse
- #format_markdown ⇒ Object
-
#initialize ⇒ Article
constructor
A new instance of Article.
Constructor Details
#initialize ⇒ Article
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
#author ⇒ Object
Returns the value of attribute author.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def @author end |
#author_link ⇒ Object
Returns the value of attribute author_link.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def @author_link end |
#avatar ⇒ Object
Returns the value of attribute avatar.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def avatar @avatar end |
#bio ⇒ Object
Returns the value of attribute bio.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def bio @bio end |
#content ⇒ Object
Returns the value of attribute content.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def content @content end |
#link ⇒ Object
Returns the value of attribute link.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def link @link end |
#published_time ⇒ Object
Returns the value of attribute published_time.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def published_time @published_time end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/zhSieve/article.rb', line 2 def title @title end |
#title_image ⇒ Object
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_markdown ⇒ Object
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 |