Class: Branchtree::Branch::Info

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(branch:, ahead_of_parent:, behind_parent:, upstream:, ahead_of_upstream:, behind_upstream:) ⇒ Info

Returns a new instance of Info.



164
165
166
167
168
169
170
171
# File 'lib/branchtree/branch.rb', line 164

def initialize(branch:, ahead_of_parent:, behind_parent:, upstream:, ahead_of_upstream:, behind_upstream:)
  @branch = branch
  @ahead_of_parent = ahead_of_parent
  @behind_parent = behind_parent
  @upstream = upstream
  @ahead_of_upstream = ahead_of_upstream
  @behind_upstream = behind_upstream
end

Instance Attribute Details

#ahead_of_parentObject (readonly)

Returns the value of attribute ahead_of_parent.



173
174
175
# File 'lib/branchtree/branch.rb', line 173

def ahead_of_parent
  @ahead_of_parent
end

#ahead_of_upstreamObject (readonly)

Returns the value of attribute ahead_of_upstream.



173
174
175
# File 'lib/branchtree/branch.rb', line 173

def ahead_of_upstream
  @ahead_of_upstream
end

#behind_parentObject (readonly)

Returns the value of attribute behind_parent.



173
174
175
# File 'lib/branchtree/branch.rb', line 173

def behind_parent
  @behind_parent
end

#behind_upstreamObject (readonly)

Returns the value of attribute behind_upstream.



173
174
175
# File 'lib/branchtree/branch.rb', line 173

def behind_upstream
  @behind_upstream
end

#upstreamObject (readonly)

Returns the value of attribute upstream.



173
174
175
# File 'lib/branchtree/branch.rb', line 173

def upstream
  @upstream
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


175
176
177
# File 'lib/branchtree/branch.rb', line 175

def empty?
  false
end

#has_upstream?Boolean

Returns:

  • (Boolean)


183
184
185
# File 'lib/branchtree/branch.rb', line 183

def has_upstream?
  @upstream != ""
end

#populateObject



187
188
189
# File 'lib/branchtree/branch.rb', line 187

def populate
  self
end

#repopulateObject



191
192
193
# File 'lib/branchtree/branch.rb', line 191

def repopulate
  NullInfo.new(@branch).populate
end

#valid?Boolean

Returns:

  • (Boolean)


179
180
181
# File 'lib/branchtree/branch.rb', line 179

def valid?
  true
end