Class: Udb::Yaml::Comment

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#columnObject (readonly)

Returns the value of attribute column.



20
21
22
# File 'lib/udb/yaml/comment_parser.rb', line 20

def column
  @column
end

#contentObject (readonly)

Returns the value of attribute content.



23
24
25
# File 'lib/udb/yaml/comment_parser.rb', line 23

def content
  @content
end

#indentObject (readonly)

Returns the value of attribute indent.



29
30
31
# File 'lib/udb/yaml/comment_parser.rb', line 29

def indent
  @indent
end

#lineObject (readonly)

Returns the value of attribute line.



17
18
19
# File 'lib/udb/yaml/comment_parser.rb', line 17

def line
  @line
end

#typeObject (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_sObject



49
50
51
# File 'lib/udb/yaml/comment_parser.rb', line 49

def to_s
  "##{content}"
end