Class: Answer
- Inherits:
-
Object
- Object
- Answer
- Defined in:
- lib/zhSieve/answer.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.
-
#question ⇒ Object
Returns the value of attribute question.
Instance Method Summary collapse
- #format_markdown ⇒ Object
-
#initialize ⇒ Answer
constructor
A new instance of Answer.
Constructor Details
#initialize ⇒ Answer
Returns a new instance of Answer.
4 5 6 7 8 9 10 11 12 |
# File 'lib/zhSieve/answer.rb', line 4 def initialize @author = 'NA' @bio = 'NA' @avatar = 'NA' @link = 'NA' @content = 'NA' @question = 'NA' @author_link = 'NA' end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
2 3 4 |
# File 'lib/zhSieve/answer.rb', line 2 def @author end |
#author_link ⇒ Object
Returns the value of attribute author_link.
2 3 4 |
# File 'lib/zhSieve/answer.rb', line 2 def @author_link end |
#avatar ⇒ Object
Returns the value of attribute avatar.
2 3 4 |
# File 'lib/zhSieve/answer.rb', line 2 def avatar @avatar end |
#bio ⇒ Object
Returns the value of attribute bio.
2 3 4 |
# File 'lib/zhSieve/answer.rb', line 2 def bio @bio end |
#content ⇒ Object
Returns the value of attribute content.
2 3 4 |
# File 'lib/zhSieve/answer.rb', line 2 def content @content end |
#link ⇒ Object
Returns the value of attribute link.
2 3 4 |
# File 'lib/zhSieve/answer.rb', line 2 def link @link end |
#question ⇒ Object
Returns the value of attribute question.
2 3 4 |
# File 'lib/zhSieve/answer.rb', line 2 def question @question end |
Instance Method Details
#format_markdown ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/zhSieve/answer.rb', line 14 def format_markdown res_file = "## " + "[#{@question}](" + @link + ")" + "\n" res_file += "### "+@avatar + "[#{@author}](" + @author_link + ")" + "\n" res_file += "#### "+@bio + "\n" res_file += "*****\n" res_file += @content res_file end |