class Conpar::Directive::Base

Base class for all Directives

Constants

SIGNATURE

Attributes

content[R]

@!attribute [r] content @return [String]

directive content
ilk[R]

@!attribute [r] ilk @return [Symbol]

shorthand type of directive
line_number[RW]

@!attribute [rw] line_number @return [String]

1-based line number within the configuration
String returned is in same encoding as the line it refers
line_span[RW]

@!attribute [rw] line_span @return [Integer]

Number of lines this directive spans within the configuration
match_data[R]

@!attribute [r] match_data @return [MatchData]

This value is to be set internally by subclasses
rule[R]

@!attribute [r] rule @return [String]

sub_ilk[R]

@!attribute [r] sub_ilk @return [String]

a.k.a. "sub type"

Public Class Methods

new(content="", options={}) click to toggle source
# File lib/conpar/directive/base.rb, line 43
def initialize(content="", options={})
  @line_number = options[:line_number]
  @line_span = options.fetch(:line_span, 1)
  @content = content.to_s.strip
  @ilk = :directive
  @sub_ilk = ""
  self
end