Class: LgPodPlugin::LPodLatestRefs

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, git, branch, tag, commit) ⇒ LPodLatestRefs

Returns a new instance of LPodLatestRefs.



33
34
35
36
37
38
39
40
# File 'lib/lg_pod_plugin/database.rb', line 33

def initialize(id, name, git, branch, tag, commit)
  self.id = id
  self.git = git
  self.tag = tag
  self.name = name
  self.branch = branch
  self.commit = commit
end

Instance Attribute Details

#branchObject

Returns the value of attribute branch.



30
31
32
# File 'lib/lg_pod_plugin/database.rb', line 30

def branch
  @branch
end

#commitObject

Returns the value of attribute commit.



31
32
33
# File 'lib/lg_pod_plugin/database.rb', line 31

def commit
  @commit
end

#gitObject

Returns the value of attribute git.



29
30
31
# File 'lib/lg_pod_plugin/database.rb', line 29

def git
  @git
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/lg_pod_plugin/database.rb', line 26

def id
  @id
end

#nameObject

Returns the value of attribute name.



27
28
29
# File 'lib/lg_pod_plugin/database.rb', line 27

def name
  @name
end

#tagObject

Returns the value of attribute tag.



28
29
30
# File 'lib/lg_pod_plugin/database.rb', line 28

def tag
  @tag
end

Class Method Details

.get_pod_id(name, git, branch, tag) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/lg_pod_plugin/database.rb', line 42

def self.get_pod_id(name, git, branch, tag)
  if git && branch
    key = name + git + branch
    return Digest::MD5.hexdigest(key)
  elsif git && tag
    key = name + git + tag
    return Digest::MD5.hexdigest(key)
  else
    key = name + git
    return Digest::MD5.hexdigest(key)
  end
end