Class: Sequence::StringLike::CorrectedMatchData

Inherits:
MatchData
  • Object
show all
Defined in:
lib/sequence/stringlike.rb

Overview


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCorrectedMatchData

Returns a new instance of CorrectedMatchData.



273
# File 'lib/sequence/stringlike.rb', line 273

def initialize; end

Instance Attribute Details

#begins=(value) ⇒ Object (writeonly)

Sets the attribute begins

Parameters:

  • value

    the value to set the attribute begins to.



276
277
278
# File 'lib/sequence/stringlike.rb', line 276

def begins=(value)
  @begins = value
end

#ends=(value) ⇒ Object (writeonly)

Sets the attribute ends

Parameters:

  • value

    the value to set the attribute ends to.



276
277
278
# File 'lib/sequence/stringlike.rb', line 276

def ends=(value)
  @ends = value
end

#groups=(value) ⇒ Object (writeonly)

Sets the attribute groups

Parameters:

  • value

    the value to set the attribute groups to.



276
277
278
# File 'lib/sequence/stringlike.rb', line 276

def groups=(value)
  @groups = value
end

#posObject

Returns the value of attribute pos.



275
276
277
# File 'lib/sequence/stringlike.rb', line 275

def pos
  @pos
end

Instance Method Details

#[](*args) ⇒ Object



294
# File 'lib/sequence/stringlike.rb', line 294

def [](*args); @groups[*args] end

#begin(n) ⇒ Object



296
# File 'lib/sequence/stringlike.rb', line 296

def begin n;  @begins[n]  end

#end(n) ⇒ Object



297
# File 'lib/sequence/stringlike.rb', line 297

def end n;    @ends[n] end

#offset(n) ⇒ Object



298
# File 'lib/sequence/stringlike.rb', line 298

def offset n; [@begins[n],@ends[n]] if n<size end

#post_matchObject



290
291
292
# File 'lib/sequence/stringlike.rb', line 290

def post_match
  @post_match_body[]
end

#pre_matchObject



286
287
288
# File 'lib/sequence/stringlike.rb', line 286

def pre_match
  @pre_match_body[]
end

#set_post_match_body(&body) ⇒ Object



282
283
284
# File 'lib/sequence/stringlike.rb', line 282

def set_post_match_body &body
  @post_match_body=body
end

#set_pre_match_body(&body) ⇒ Object



278
279
280
# File 'lib/sequence/stringlike.rb', line 278

def set_pre_match_body &body
  @pre_match_body=body
end

#sizeObject Also known as: length



302
# File 'lib/sequence/stringlike.rb', line 302

def size;     @groups.size end

#to_aObject



300
# File 'lib/sequence/stringlike.rb', line 300

def to_a;     @groups end

#to_sObject



301
# File 'lib/sequence/stringlike.rb', line 301

def to_s;     @groups.first end