Class: Kang::OffSetMatchData

Inherits:
Object
  • Object
show all
Defined in:
lib/kang/offset_data.rb

Instance Method Summary collapse

Constructor Details

#initialize(offset, match_data) ⇒ OffSetMatchData

Returns a new instance of OffSetMatchData.



17
18
19
20
# File 'lib/kang/offset_data.rb', line 17

def initialize(offset,match_data)
  @offset = offset
  @match_data = match_data
end

Instance Method Details

#[](x) ⇒ Object



42
43
44
# File 'lib/kang/offset_data.rb', line 42

def [](x)
  @match_data[x]
end

#begin(i) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/kang/offset_data.rb', line 22

def begin(i)
  if @match_data.begin(i) 
    @match_data.begin(i) + @offset
  else
    @offset
  end
end

#end(i) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/kang/offset_data.rb', line 30

def end(i)
  if @match_data.end(i) 
    @match_data.end(i) + @offset
  else
    @offset
  end
end

#lengthObject



38
39
40
# File 'lib/kang/offset_data.rb', line 38

def length
  @match_data.length
end

#namesObject



46
47
48
# File 'lib/kang/offset_data.rb', line 46

def names
  @match_data.names
end

#to_aObject



50
51
52
# File 'lib/kang/offset_data.rb', line 50

def to_a
  @match_data.to_a
end