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)

Parameters:

  • line (Integer)
  • column (Integer)
  • content (String)
  • type (Symbol)
  • indent (Integer)


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

#columnInteger (readonly)

Returns:

  • (Integer)


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

def column
  @column
end

#contentString (readonly)

Returns:

  • (String)


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

def content
  @content
end

#indentInteger (readonly)

Returns:

  • (Integer)


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

def indent
  @indent
end

#lineInteger (readonly)

Returns:

  • (Integer)


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

def line
  @line
end

#typeSymbol (readonly)

Returns:

  • (Symbol)


26
27
28
# File 'lib/udb/yaml/comment_parser.rb', line 26

def type
  @type
end

Instance Method Details

#to_sString

Returns:

  • (String)


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

def to_s
  "##{content}"
end