Class: VER::Text::Index
Constant Summary
collapse
- LINE =
/^\d+/
- CHAR =
/\d+$/
Constants inherited
from Struct
Struct::CACHE
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Position
#+, #-, #<=>, #bbox, #change_line, #compare, #copy_line, #decrease_number, #delete, #delete_line, #delta, #dlineinfo, #dump, #formatted_binary, #formatted_exponential, #formatted_float, #formatted_hex, #formatted_number, #formatted_octal, #get, #increase_number, #insert, #kill_line, #lineend, #linestart, #see, #tag_names, #tags, #toggle_case!
Methods inherited from Struct
new
Instance Attribute Details
#buffer ⇒ Object
Returns the value of attribute buffer
3
4
5
|
# File 'lib/ver/text/index.rb', line 3
def buffer
@buffer
end
|
#index ⇒ Object
Returns the value of attribute index
3
4
5
|
# File 'lib/ver/text/index.rb', line 3
def index
@index
end
|
Instance Method Details
#char ⇒ Object
13
14
15
|
# File 'lib/ver/text/index.rb', line 13
def char
index.to_s[CHAR].to_i
end
|
#inspect ⇒ Object
30
31
32
|
# File 'lib/ver/text/index.rb', line 30
def inspect
"#<VER::Text::Index %p on %p>" % [index, buffer]
end
|
#line ⇒ Object
9
10
11
|
# File 'lib/ver/text/index.rb', line 9
def line
index.to_s[LINE].to_i
end
|
#to_a ⇒ Object
25
26
27
28
|
# File 'lib/ver/text/index.rb', line 25
def to_a
line, char = index.split('.')
return line.to_i, char.to_i
end
|
#to_s ⇒ Object
21
22
23
|
# File 'lib/ver/text/index.rb', line 21
def to_s
index.to_s
end
|
#to_tcl ⇒ Object
17
18
19
|
# File 'lib/ver/text/index.rb', line 17
def to_tcl
index
end
|