Class: Udb::Yaml::Comment
- Inherits:
-
Object
- Object
- Udb::Yaml::Comment
- Extended by:
- T::Sig
- Defined in:
- lib/udb/yaml/comment_parser.rb
Overview
Represents a single comment in a YAML file
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#indent ⇒ Object
readonly
Returns the value of attribute indent.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(line, column, content, type, indent) ⇒ Comment
constructor
A new instance of Comment.
- #to_s ⇒ Object
Constructor Details
#initialize(line, column, content, type, indent) ⇒ Comment
Returns a new instance of Comment.
40 41 42 43 44 45 46 |
# File 'lib/udb/yaml/comment_parser.rb', line 40 def initialize(line, column, content, type, indent) @line = T.let(line, Integer) @column = T.let(column, Integer) @content = T.let(content, String) @type = T.let(type, Symbol) @indent = T.let(indent, Integer) end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
20 21 22 |
# File 'lib/udb/yaml/comment_parser.rb', line 20 def column @column end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
23 24 25 |
# File 'lib/udb/yaml/comment_parser.rb', line 23 def content @content end |
#indent ⇒ Object (readonly)
Returns the value of attribute indent.
29 30 31 |
# File 'lib/udb/yaml/comment_parser.rb', line 29 def indent @indent end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
17 18 19 |
# File 'lib/udb/yaml/comment_parser.rb', line 17 def line @line end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
26 27 28 |
# File 'lib/udb/yaml/comment_parser.rb', line 26 def type @type end |
Instance Method Details
#to_s ⇒ Object
49 50 51 |
# File 'lib/udb/yaml/comment_parser.rb', line 49 def to_s "##{content}" end |