class Aio::Text::MatchStringInfo
将提取的关键信息附带的增加所在上下文以及行数
Attributes
compare_val[RW]
存放比较后的不同值,也是 MachStringInfo 类
Public Class Methods
new(var, content, line)
click to toggle source
Calls superclass method
# File lib/aio/core/text/match_string_info.rb, line 9 def initialize(var, content, line) super( var, content, line ) end
Public Instance Methods
compare_content()
click to toggle source
差异值的文本
# File lib/aio/core/text/match_string_info.rb, line 49 def compare_content compare_val.content end
compare_line()
click to toggle source
差异值的行数
# File lib/aio/core/text/match_string_info.rb, line 54 def compare_line compare_val.line end
compare_val?()
click to toggle source
判断是否有compare_val值
# File lib/aio/core/text/match_string_info.rb, line 44 def compare_val? !@compare_val.nil? end
content()
click to toggle source
# File lib/aio/core/text/match_string_info.rb, line 59 def content; self[:content]; end
eql?(other_match)
click to toggle source
覆盖原有的eql?
# File lib/aio/core/text/match_string_info.rb, line 26 def eql?(other_match) self.to_s.eql?(other_match.to_s) end
inspect()
click to toggle source
# File lib/aio/core/text/match_string_info.rb, line 17 def inspect var.to_s end
line()
click to toggle source
# File lib/aio/core/text/match_string_info.rb, line 60 def line; self[:line]; end
method_missing(m, *args)
click to toggle source
Calls superclass method
# File lib/aio/core/text/match_string_info.rb, line 62 def method_missing(m, *args) if var.respond_to?(m) var.send(m, *args) else super end end
same_content?(other_match)
click to toggle source
判断和另一个class是否是同一个content
# File lib/aio/core/text/match_string_info.rb, line 31 def same_content?(other_match) content == other_match.content end
same_line?(other_match)
click to toggle source
判断是否和另一个值为同一行
# File lib/aio/core/text/match_string_info.rb, line 36 def same_line?(other_match) if same_content? return line == other_match.line end return false end
to_s()
click to toggle source
# File lib/aio/core/text/match_string_info.rb, line 21 def to_s var end
var()
click to toggle source
# File lib/aio/core/text/match_string_info.rb, line 58 def var; self[:var].to_s; end