Class: Kosmos::GitAdapter::Commit

Inherits:
Struct
  • Object
show all
Defined in:
lib/kosmos/git_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



39
40
41
# File 'lib/kosmos/git_adapter.rb', line 39

def message
  @message
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



39
40
41
# File 'lib/kosmos/git_adapter.rb', line 39

def sha
  @sha
end

Instance Method Details

#post?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/kosmos/git_adapter.rb', line 44

def post?
  type == :post
end

#pre?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/kosmos/git_adapter.rb', line 40

def pre?
  type == :pre
end

#subjectObject



57
58
59
60
# File 'lib/kosmos/git_adapter.rb', line 57

def subject
  # "POST: Example\n" --> "Example"
  message.split(' ', 2).last.strip
end

#typeObject



52
53
54
55
# File 'lib/kosmos/git_adapter.rb', line 52

def type
  # "POST: Example" --> :post
  message.split(':').first.downcase.to_sym
end

#uninstall?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/kosmos/git_adapter.rb', line 48

def uninstall?
  type == :uninstall
end