Class: Deal::DealResult

Inherits:
Object
  • Object
show all
Defined in:
lib/deal/utils/deal_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, item, match_key, action) ⇒ DealResult

Returns a new instance of DealResult.



20
21
22
23
24
25
# File 'lib/deal/utils/deal_config.rb', line 20

def initialize(type,item,match_key,action)
    @type = type
    @item = item
    @match_key = match_key
    @action = action
end

Instance Method Details

#set_line_n(line) ⇒ Object



27
28
29
# File 'lib/deal/utils/deal_config.rb', line 27

def set_line_n(line)
    @line_n = line
end

#set_path(path) ⇒ Object



31
32
33
# File 'lib/deal/utils/deal_config.rb', line 31

def set_path(path)
    @file_path = path
end

#to_sObject



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/deal/utils/deal_config.rb', line 34

def to_s
    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
    s.push "file_path:#{@file_path}" if @file_path
    s.push "line_number:#{@line_n}" if @line_n
    s.push '}'

    return s.join("\n")
end