Class: Sequence::StringLike::CorrectedMatchData
- Inherits:
-
MatchData
- Object
- MatchData
- Sequence::StringLike::CorrectedMatchData
- Defined in:
- lib/sequence/stringlike.rb
Overview
Instance Attribute Summary collapse
-
#begins ⇒ Object
writeonly
Sets the attribute begins.
-
#ends ⇒ Object
writeonly
Sets the attribute ends.
-
#groups ⇒ Object
writeonly
Sets the attribute groups.
-
#pos ⇒ Object
Returns the value of attribute pos.
Instance Method Summary collapse
- #[](*args) ⇒ Object
- #begin(n) ⇒ Object
- #end(n) ⇒ Object
-
#initialize ⇒ CorrectedMatchData
constructor
A new instance of CorrectedMatchData.
- #offset(n) ⇒ Object
- #post_match ⇒ Object
- #pre_match ⇒ Object
- #set_post_match_body(&body) ⇒ Object
- #set_pre_match_body(&body) ⇒ Object
- #size ⇒ Object (also: #length)
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ CorrectedMatchData
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
276 277 278 |
# File 'lib/sequence/stringlike.rb', line 276 def begins=(value) @begins = value end |
#ends=(value) ⇒ Object (writeonly)
Sets the attribute ends
276 277 278 |
# File 'lib/sequence/stringlike.rb', line 276 def ends=(value) @ends = value end |
#groups=(value) ⇒ Object (writeonly)
Sets the attribute groups
276 277 278 |
# File 'lib/sequence/stringlike.rb', line 276 def groups=(value) @groups = value end |
#pos ⇒ Object
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_match ⇒ Object
290 291 292 |
# File 'lib/sequence/stringlike.rb', line 290 def post_match @post_match_body[] end |
#pre_match ⇒ Object
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 |
#size ⇒ Object Also known as: length
302 |
# File 'lib/sequence/stringlike.rb', line 302 def size; @groups.size end |
#to_a ⇒ Object
300 |
# File 'lib/sequence/stringlike.rb', line 300 def to_a; @groups end |
#to_s ⇒ Object
301 |
# File 'lib/sequence/stringlike.rb', line 301 def to_s; @groups.first end |