Class: MultiRepo::LockEntry
- Inherits:
-
Object
- Object
- MultiRepo::LockEntry
- Defined in:
- lib/multirepo/files/lock-entry.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#head ⇒ Object
Returns the value of attribute head.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #encode_with(coder) ⇒ Object
-
#initialize(config_entry) ⇒ LockEntry
constructor
A new instance of LockEntry.
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
#branch ⇒ Object
Returns the value of attribute branch.
9 10 11 |
# File 'lib/multirepo/files/lock-entry.rb', line 9 def branch @branch end |
#head ⇒ Object
Returns the value of attribute head.
8 9 10 |
# File 'lib/multirepo/files/lock-entry.rb', line 8 def head @head end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/multirepo/files/lock-entry.rb', line 7 def id @id end |
#name ⇒ Object
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 |