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



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

def message
  @message
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



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

def sha
  @sha
end

Instance Method Details

#post?Boolean

Returns:

  • (Boolean)


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

def post?
  type == :post
end

#pre?Boolean

Returns:

  • (Boolean)


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

def pre?
  type == :pre
end

#subjectObject



65
66
67
68
# File 'lib/kosmos/git_adapter.rb', line 65

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

#typeObject



60
61
62
63
# File 'lib/kosmos/git_adapter.rb', line 60

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

#uninstall?Boolean

Returns:

  • (Boolean)


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

def uninstall?
  type == :uninstall
end