Class: Aio::Text::LineString
- Inherits:
-
String
- Object
- String
- Aio::Text::LineString
- Includes:
- Ui::Verbose
- Defined in:
- lib/aio/core/text/line_string.rb
Defined Under Namespace
Classes: Mismatch
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
-
#match_block(reg, cont, line) {|block| ... } ⇒ Object
获得区块 并且获得所在的行数.
Methods included from Ui::Verbose
#clear_line, #print_error, #print_good, #progress_bar
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/aio/core/text/line_string.rb', line 7 def content @content end |
#line ⇒ Object
Returns the value of attribute line.
7 8 9 |
# File 'lib/aio/core/text/line_string.rb', line 7 def line @line end |
Instance Method Details
#match_block(reg, cont, line) {|block| ... } ⇒ Object
获得区块并且获得所在的行数
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/aio/core/text/line_string.rb', line 13 def match_block(reg, cont, line) block = Block.new(reg.match(self)) #raise Mismatch.new, "reg: #{reg}\nstr: #{self.to_s}" if block.nil? if block.nil? return false end block.content = cont block.line = line yield block end |