Class: Pronto::Message
- Inherits:
-
Object
- Object
- Pronto::Message
- Defined in:
- lib/pronto/message.rb
Constant Summary collapse
- LEVELS =
[:info, :warning, :error, :fatal]
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, line, level, msg) ⇒ Message
constructor
A new instance of Message.
- #repo ⇒ Object
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
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/pronto/message.rb', line 3 def level @level end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
3 4 5 |
# File 'lib/pronto/message.rb', line 3 def line @line end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
3 4 5 |
# File 'lib/pronto/message.rb', line 3 def msg @msg end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/pronto/message.rb', line 3 def path @path end |
Instance Method Details
#repo ⇒ Object
15 16 17 |
# File 'lib/pronto/message.rb', line 15 def repo line.patch.delta.repo end |