Class: Yoda::Model::Descriptions::CommentTokenDescription
- Defined in:
- lib/yoda/model/descriptions/comment_token_description.rb
Instance Attribute Summary collapse
- #comment_token ⇒ AST::CommentBlock::Token readonly
- #type ⇒ TypeExpressions::Base readonly
Instance Method Summary collapse
-
#initialize(comment_token, type) ⇒ CommentTokenDescription
constructor
A new instance of CommentTokenDescription.
- #markup_content ⇒ Object
- #sort_text ⇒ String
- #title ⇒ String
- #to_markdown ⇒ String
Methods inherited from Base
Constructor Details
#initialize(comment_token, type) ⇒ CommentTokenDescription
Returns a new instance of CommentTokenDescription.
13 14 15 16 |
# File 'lib/yoda/model/descriptions/comment_token_description.rb', line 13 def initialize(comment_token, type) @comment_token = comment_token @type = type end |
Instance Attribute Details
#comment_token ⇒ AST::CommentBlock::Token (readonly)
6 7 8 |
# File 'lib/yoda/model/descriptions/comment_token_description.rb', line 6 def comment_token @comment_token end |
#type ⇒ TypeExpressions::Base (readonly)
9 10 11 |
# File 'lib/yoda/model/descriptions/comment_token_description.rb', line 9 def type @type end |
Instance Method Details
#markup_content ⇒ Object
37 38 39 40 41 42 |
# File 'lib/yoda/model/descriptions/comment_token_description.rb', line 37 def markup_content { language: 'ruby', value: "#{title.gsub("\n", ";")} # #{type}", } end |
#sort_text ⇒ String
24 25 26 |
# File 'lib/yoda/model/descriptions/comment_token_description.rb', line 24 def sort_text comment_token.content end |
#title ⇒ String
19 20 21 |
# File 'lib/yoda/model/descriptions/comment_token_description.rb', line 19 def title comment_token.content end |
#to_markdown ⇒ String
29 30 31 32 33 34 35 |
# File 'lib/yoda/model/descriptions/comment_token_description.rb', line 29 def to_markdown <<~EOS **#{title}** #{value.document} EOS end |