Class: MultiRepo::LockEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/multirepo/files/lock-entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_entry) ⇒ LockEntry

Returns a new instance of LockEntry.



18
19
20
21
22
23
24
25
26
27
# File 'lib/multirepo/files/lock-entry.rb', line 18

def initialize(config_entry)
  @name = config_entry.name
  @id = config_entry.id
  
  head = config_entry.repo.head
  @head = head.commit_id
  
  current_branch = config_entry.repo.current_branch
  @branch = current_branch ? current_branch.name : nil
end

Instance Attribute Details

#branchObject

Returns the value of attribute branch.



9
10
11
# File 'lib/multirepo/files/lock-entry.rb', line 9

def branch
  @branch
end

#headObject

Returns the value of attribute head.



8
9
10
# File 'lib/multirepo/files/lock-entry.rb', line 8

def head
  @head
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/multirepo/files/lock-entry.rb', line 7

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/multirepo/files/lock-entry.rb', line 6

def name
  @name
end

Instance Method Details

#encode_with(coder) ⇒ Object



11
12
13
14
15
16
# File 'lib/multirepo/files/lock-entry.rb', line 11

def encode_with(coder)
  coder["name"] = @name
  coder["id"] = @id
  coder["head"] = @head
  coder["branch"] = @branch
end