Class: Pronto::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/pronto/message.rb

Constant Summary collapse

LEVELS =
[:info, :warning, :error, :fatal]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, line, level, msg) ⇒ Message



7
8
9
10
11
12
13
# File 'lib/pronto/message.rb', line 7

def initialize(path, line, level, msg)
  unless LEVELS.include?(level)
    raise ::ArgumentError, "level should be set to one of #{LEVELS}"
  end

  @path, @line, @level, @msg = path, line, level, msg
end

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level.



3
4
5
# File 'lib/pronto/message.rb', line 3

def level
  @level
end

#lineObject (readonly)

Returns the value of attribute line.



3
4
5
# File 'lib/pronto/message.rb', line 3

def line
  @line
end

#msgObject (readonly)

Returns the value of attribute msg.



3
4
5
# File 'lib/pronto/message.rb', line 3

def msg
  @msg
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/pronto/message.rb', line 3

def path
  @path
end

Instance Method Details

#repoObject



15
16
17
# File 'lib/pronto/message.rb', line 15

def repo
  line.patch.delta.repo
end