Class: Mj::Git::LocalBranch

Inherits:
Object
  • Object
show all
Defined in:
lib/mj/git/local_branch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ LocalBranch

Returns a new instance of LocalBranch.



8
9
10
# File 'lib/mj/git/local_branch.rb', line 8

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/mj/git/local_branch.rb', line 6

def name
  @name
end

Instance Method Details

#checkout_commandObject



16
17
18
# File 'lib/mj/git/local_branch.rb', line 16

def checkout_command
  "git checkout #{name}"
end

#lengthObject



12
13
14
# File 'lib/mj/git/local_branch.rb', line 12

def length
  @name.length
end

#to_localObject



20
21
22
# File 'lib/mj/git/local_branch.rb', line 20

def to_local
  self
end