class Deal::DealResult

Public Class Methods

new(type,item,match_key,action,path) click to toggle source
# File lib/deal/utils/deal_config.rb, line 20
def initialize(type,item,match_key,action,path)
    @type = type
    @item = item.strip if item
    @match_key = match_key
    @action = action
    @file_path = path
end

Public Instance Methods

set_line_n(line) click to toggle source
# File lib/deal/utils/deal_config.rb, line 28
def set_line_n(line)
    @line_n = line
end
set_path(path) click to toggle source
# File lib/deal/utils/deal_config.rb, line 32
def set_path(path)
    @file_path = path
end
to_s(verbose = false ) click to toggle source
# File lib/deal/utils/deal_config.rb, line 35
def to_s(verbose = false )
    if verbose
        s = []
        s.push '{'
        # s.push "type:#{@type}" if @type
        s.push "match_item:#{@item}" if @item
        s.push "match_key:#{@match_key}" if @match_key
        s.push "action:#{@action}" if @action && @action.length > 0
        s.push "file_path:#{@file_path}" if @file_path
        s.push "line_number:#{@line_n}" if @line_n
        s.push '}'

        return s.join("\n")
    else
        s = []
        s.push "#{@file_path}" if @file_path
        s.push "#{@item}" if @item
        return s.join(":")
    end

end