Class: Bijou::Parse::Message
- Inherits:
-
Object
- Object
- Bijou::Parse::Message
- Defined in:
- lib/bijou/diagnostics.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
- #<<(s) ⇒ Object
- #at(line, column) ⇒ Object
-
#initialize ⇒ Message
constructor
A new instance of Message.
- #text ⇒ Object
Constructor Details
#initialize ⇒ Message
Returns a new instance of Message.
12 13 14 15 16 17 |
# File 'lib/bijou/diagnostics.rb', line 12 def initialize @line = nil @column = nil @prefix = nil @text = '' end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
19 20 21 |
# File 'lib/bijou/diagnostics.rb', line 19 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
19 20 21 |
# File 'lib/bijou/diagnostics.rb', line 19 def line @line end |
Instance Method Details
#<<(s) ⇒ Object
26 27 28 |
# File 'lib/bijou/diagnostics.rb', line 26 def <<(s) @text << s.to_s end |
#at(line, column) ⇒ Object
21 22 23 24 |
# File 'lib/bijou/diagnostics.rb', line 21 def at(line, column) @line = line @column = column end |
#text ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/bijou/diagnostics.rb', line 30 def text result = '' result << @prefix if @prefix result << "(#{@line}, #{@column || 0})" if @line result << ": " + @text result end |