Class: PreCommit::Message

Inherits:
Struct
  • Object
show all
Defined in:
lib/pre-commit/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#linesObject

Returns the value of attribute lines

Returns:

  • (Object)

    the current value of lines



2
3
4
# File 'lib/pre-commit/message.rb', line 2

def lines
  @lines
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



2
3
4
# File 'lib/pre-commit/message.rb', line 2

def message
  @message
end

Instance Method Details

#to_sObject



4
5
6
7
8
# File 'lib/pre-commit/message.rb', line 4

def to_s
  result = message
  result = "#{message}\n#{lines.map(&:to_s).join("\n")}" unless lines.nil?
  result
end