Class: IgnoredLine

Inherits:
Object
  • Object
show all
Defined in:
lib/cless/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str, off) ⇒ IgnoredLine

Returns a new instance of IgnoredLine.



248
249
250
251
252
# File 'lib/cless/data.rb', line 248

def initialize(str, off)
  @str = str
  @has_match = false
  @off = off                  # Byte offset in file of beginning of line
end

Instance Attribute Details

#has_matchObject (readonly)

Returns the value of attribute has_match.



246
247
248
# File 'lib/cless/data.rb', line 246

def has_match
  @has_match
end

#offObject (readonly)

Returns the value of attribute off.



246
247
248
# File 'lib/cless/data.rb', line 246

def off
  @off
end

#strObject (readonly)

Returns the value of attribute str.



246
247
248
# File 'lib/cless/data.rb', line 246

def str
  @str
end

Instance Method Details

#clear_matchObject



262
# File 'lib/cless/data.rb', line 262

def clear_match; @has_match = false; @m = nil; end

#highlightObject Also known as: highlight?

An ignored line is never highlighted



268
# File 'lib/cless/data.rb', line 268

def highlight; false; end

#highlight=(*args) ⇒ Object



271
# File 'lib/cless/data.rb', line 271

def highlight=(*args); end

#ignoredObject Also known as: ignored?



264
# File 'lib/cless/data.rb', line 264

def ignored; true; end

#match(pattern) ⇒ Object



254
255
256
257
258
259
# File 'lib/cless/data.rb', line 254

def match(pattern)
  if m = @str.match(pattern)
    @m = m
    @has_match = true
  end
end

#matchesObject



261
# File 'lib/cless/data.rb', line 261

def matches; @m; end