Sha256: fe38eca0add3d24a9708941505ccc065191a824932f73fa214303e92ff3edc7d

Contents?: true

Size: 341 Bytes

Versions: 3

Compression:

Stored size: 341 Bytes

Contents

class ChangeCounter
  
  attr_accessor :version
  def initialize(version)
    @version = version
  end

  def count
    version.version_attributes.length + changed_child_attributes
  end

  private
  def changed_child_attributes
    version.version_children.collect{ |child| ChangeCounter.new(child).count }.
      inject(:+) || 0
  end

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
rubber_stamp-0.15.1 lib/rubber_stamp/change_counter.rb
rubber_stamp-0.13.0 lib/rubber_stamp/change_counter.rb
controlled_versioning-0.12.0 lib/controlled_versioning/change_counter.rb