Class: Psych::Pure::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/psych/pure.rb

Overview

Represents a comment in the input.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, pos_start, pos_end, value, inline) ⇒ Comment



144
145
146
147
148
149
150
# File 'lib/psych/pure.rb', line 144

def initialize(source, pos_start, pos_end, value, inline)
  @source = source
  @pos_start = pos_start
  @pos_end = pos_end
  @value = value
  @inline = inline
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



142
143
144
# File 'lib/psych/pure.rb', line 142

def value
  @value
end

Instance Method Details

#end_columnObject



168
169
170
# File 'lib/psych/pure.rb', line 168

def end_column
  @source.column(@pos_end)
end

#end_lineObject



164
165
166
# File 'lib/psych/pure.rb', line 164

def end_line
  @source.line(@pos_end)
end

#inline?Boolean



152
153
154
# File 'lib/psych/pure.rb', line 152

def inline?
  @inline
end

#start_columnObject



160
161
162
# File 'lib/psych/pure.rb', line 160

def start_column
  @source.column(@pos_start)
end

#start_lineObject



156
157
158
# File 'lib/psych/pure.rb', line 156

def start_line
  @source.line(@pos_start)
end