Class: AsciiDataTools::RecordType::Field::FixedLengthConstraint

Inherits:
Constraint
  • Object
show all
Defined in:
lib/ascii-data-tools/record_type/field.rb

Instance Method Summary collapse

Methods inherited from Constraint

#satisfied_by?

Constructor Details

#initialize(length) ⇒ FixedLengthConstraint

Returns a new instance of FixedLengthConstraint.



120
121
122
# File 'lib/ascii-data-tools/record_type/field.rb', line 120

def initialize(length)
  @length = length
end

Instance Method Details

#extend_regexp_string_for_matching(regexp_string) ⇒ Object



124
125
126
# File 'lib/ascii-data-tools/record_type/field.rb', line 124

def extend_regexp_string_for_matching(regexp_string)
  regexp_string + "(.{#{@length}})"
end

#to_sObject



128
# File 'lib/ascii-data-tools/record_type/field.rb', line 128

def to_s; ""; end