Class: Gitlab::GithubImport::MarkdownText
- Inherits:
-
Object
- Object
- Gitlab::GithubImport::MarkdownText
- Defined in:
- lib/gitlab/github_import/markdown_text.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#exists ⇒ Object
readonly
Returns the value of attribute exists.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text, author, exists = false) ⇒ MarkdownText
constructor
text - The Markdown text as a String.
- #to_s ⇒ Object
Constructor Details
#initialize(text, author, exists = false) ⇒ MarkdownText
text - The Markdown text as a String. author - An instance of `Gitlab::GithubImport::Representation::User` exists - Boolean that indicates the user exists in the GitLab database.
15 16 17 18 19 |
# File 'lib/gitlab/github_import/markdown_text.rb', line 15 def initialize(text, , exists = false) @text = text @author = @exists = exists end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author
6 7 8 |
# File 'lib/gitlab/github_import/markdown_text.rb', line 6 def @author end |
#exists ⇒ Object (readonly)
Returns the value of attribute exists
6 7 8 |
# File 'lib/gitlab/github_import/markdown_text.rb', line 6 def exists @exists end |
#text ⇒ Object (readonly)
Returns the value of attribute text
6 7 8 |
# File 'lib/gitlab/github_import/markdown_text.rb', line 6 def text @text end |
Class Method Details
.format(*args) ⇒ Object
8 9 10 |
# File 'lib/gitlab/github_import/markdown_text.rb', line 8 def self.format(*args) new(*args).to_s end |
Instance Method Details
#to_s ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/gitlab/github_import/markdown_text.rb', line 21 def to_s if exists text else "*Created by: #{.login}*\n\n#{text}" end end |