Class: Gitt::Models::Commit

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitt/models/commit.rb

Overview

Represents commit details.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommit

Returns a new instance of Commit.



25
26
27
28
# File 'lib/gitt/models/commit.rb', line 25

def initialize(**)
  super
  freeze
end

Instance Attribute Details

#author_emailObject

Returns the value of attribute author_email

Returns:

  • (Object)

    the current value of author_email



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def author_email
  @author_email
end

#author_nameObject

Returns the value of attribute author_name

Returns:

  • (Object)

    the current value of author_name



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def author_name
  @author_name
end

#authored_atObject

Returns the value of attribute authored_at

Returns:

  • (Object)

    the current value of authored_at



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def authored_at
  @authored_at
end

#authored_relative_atObject

Returns the value of attribute authored_relative_at

Returns:

  • (Object)

    the current value of authored_relative_at



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def authored_relative_at
  @authored_relative_at
end

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def body
  @body
end

#body_linesObject

Returns the value of attribute body_lines

Returns:

  • (Object)

    the current value of body_lines



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def body_lines
  @body_lines
end

#body_paragraphsObject

Returns the value of attribute body_paragraphs

Returns:

  • (Object)

    the current value of body_paragraphs



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def body_paragraphs
  @body_paragraphs
end

#committed_atObject

Returns the value of attribute committed_at

Returns:

  • (Object)

    the current value of committed_at



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def committed_at
  @committed_at
end

#committed_relative_atObject

Returns the value of attribute committed_relative_at

Returns:

  • (Object)

    the current value of committed_relative_at



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def committed_relative_at
  @committed_relative_at
end

#committer_emailObject

Returns the value of attribute committer_email

Returns:

  • (Object)

    the current value of committer_email



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def committer_email
  @committer_email
end

#committer_nameObject

Returns the value of attribute committer_name

Returns:

  • (Object)

    the current value of committer_name



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def committer_name
  @committer_name
end

#linesObject

Returns the value of attribute lines

Returns:

  • (Object)

    the current value of lines



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def lines
  @lines
end

#rawObject

Returns the value of attribute raw

Returns:

  • (Object)

    the current value of raw



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def raw
  @raw
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def sha
  @sha
end

#signatureObject

Returns the value of attribute signature

Returns:

  • (Object)

    the current value of signature



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def signature
  @signature
end

#subjectObject

Returns the value of attribute subject

Returns:

  • (Object)

    the current value of subject



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def subject
  @subject
end

#trailersObject

Returns the value of attribute trailers

Returns:

  • (Object)

    the current value of trailers



6
7
8
# File 'lib/gitt/models/commit.rb', line 6

def trailers
  @trailers
end

Instance Method Details

#amend?Boolean

Returns:

  • (Boolean)


30
# File 'lib/gitt/models/commit.rb', line 30

def amend? = subject.match?(/\Aamend!\s/)

#fixup?Boolean

Returns:

  • (Boolean)


32
# File 'lib/gitt/models/commit.rb', line 32

def fixup? = subject.match?(/\Afixup!\s/)

#prefix?Boolean

Returns:

  • (Boolean)


36
# File 'lib/gitt/models/commit.rb', line 36

def prefix? = amend? || fixup? || squash?

#squash?Boolean

Returns:

  • (Boolean)


34
# File 'lib/gitt/models/commit.rb', line 34

def squash? = subject.match?(/\Asquash!\s/)