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



37
38
39
# File 'lib/kosmos/git_adapter.rb', line 37

def message
  @message
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



37
38
39
# File 'lib/kosmos/git_adapter.rb', line 37

def sha
  @sha
end

Instance Method Details

#post?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/kosmos/git_adapter.rb', line 42

def post?
  type == :post
end

#pre?Boolean

Returns:

  • (Boolean)


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

def pre?
  type == :pre
end

#subjectObject



55
56
57
58
# File 'lib/kosmos/git_adapter.rb', line 55

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

#typeObject



50
51
52
53
# File 'lib/kosmos/git_adapter.rb', line 50

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

#uninstall?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/kosmos/git_adapter.rb', line 46

def uninstall?
  type == :uninstall
end