Class: Hubeye::Server::Commit

Inherits:
Object
  • Object
show all
Defined in:
lib/hubeye/server/commit.rb

Overview

simple interface to Github’s api v3 for commits

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_name, raw_commit_ary) ⇒ Commit

Returns a new instance of Commit.



8
9
10
11
12
13
14
# File 'lib/hubeye/server/commit.rb', line 8

def initialize(repo_name, raw_commit_ary)
  commit_hash = parse_raw_commit_ary(raw_commit_ary)
  @repo_name = repo_name
  @sha = commit_hash['sha']
  @message = commit_hash['commit']['message']
  @committer_name = commit_hash['commit']['committer']['name']
end

Instance Attribute Details

#committer_nameObject (readonly)

Returns the value of attribute committer_name.



6
7
8
# File 'lib/hubeye/server/commit.rb', line 6

def committer_name
  @committer_name
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/hubeye/server/commit.rb', line 6

def message
  @message
end

#repo_nameObject (readonly)

Returns the value of attribute repo_name.



6
7
8
# File 'lib/hubeye/server/commit.rb', line 6

def repo_name
  @repo_name
end

#shaObject (readonly)

Returns the value of attribute sha.



6
7
8
# File 'lib/hubeye/server/commit.rb', line 6

def sha
  @sha
end