Class: BzrWrapper::Log

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

Overview

represents the branch-log with <n> ‘Commit’s

Constant Summary collapse

SEPARATOR =
'------------------------------------------------------------'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(le_array, &block) ⇒ Log

Returns a new instance of Log.



207
208
209
210
211
# File 'lib/bzrwrapper.rb', line 207

def initialize(le_array, &block)
  @count = le_array.length
  @commits = le_array
  block_given? ? @commits.each { |x| yield x }  : self
end

Instance Attribute Details

#commitsObject (readonly)

array of BzrWrapper::Commit’s of this BzrWrapper::Log



205
206
207
# File 'lib/bzrwrapper.rb', line 205

def commits
  @commits
end

#countObject (readonly)

num of log-entries



203
204
205
# File 'lib/bzrwrapper.rb', line 203

def count
  @count
end

Instance Method Details

#each_entryObject

Iterates over supplied Commits.



214
215
216
# File 'lib/bzrwrapper.rb', line 214

def each_entry
  block_given? ? @commits.each { |c| yield c } : @commits
end