Class: GithubMetadata::Commit

Inherits:
Object
  • Object
show all
Defined in:
lib/github_metadata.rb

Overview

Object representation of a commit, initialized from a github repo commit feed entry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(atom_entry) ⇒ Commit

Returns a new instance of Commit.



27
28
29
30
31
32
33
34
# File 'lib/github_metadata.rb', line 27

def initialize(atom_entry)
  @atom_entry = atom_entry
  @title = atom_entry.title
  @message = atom_entry.content
  @author = atom_entry.author
  @committed_at = atom_entry.updated.kind_of?(Time) ? atom_entry.updated : Time.parse(atom_entry.updated)
  @url = atom_entry.url
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



25
26
27
# File 'lib/github_metadata.rb', line 25

def author
  @author
end

#committed_atObject (readonly)

Returns the value of attribute committed_at.



25
26
27
# File 'lib/github_metadata.rb', line 25

def committed_at
  @committed_at
end

#messageObject (readonly)

Returns the value of attribute message.



25
26
27
# File 'lib/github_metadata.rb', line 25

def message
  @message
end

#titleObject (readonly)

Returns the value of attribute title.



25
26
27
# File 'lib/github_metadata.rb', line 25

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



25
26
27
# File 'lib/github_metadata.rb', line 25

def url
  @url
end