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



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

def message
  @message
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



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

def sha
  @sha
end

Instance Method Details

#post?Boolean

Returns:

  • (Boolean)


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

def post?
  type == :post
end

#pre?Boolean

Returns:

  • (Boolean)


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

def pre?
  type == :pre
end

#subjectObject



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

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

#typeObject



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

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

#uninstall?Boolean

Returns:

  • (Boolean)


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

def uninstall?
  type == :uninstall
end