Class: Answer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAnswer

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

#authorObject

Returns the value of attribute author.



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

def author
  @author
end

Returns the value of attribute author_link.



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

def author_link
  @author_link
end

#avatarObject

Returns the value of attribute avatar.



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

def avatar
  @avatar
end

#bioObject

Returns the value of attribute bio.



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

def bio
  @bio
end

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

Returns the value of attribute link.



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

def link
  @link
end

#questionObject

Returns the value of attribute question.



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

def question
  @question
end

Instance Method Details

#format_markdownObject



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