Class: ChangeCounter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ ChangeCounter

Returns a new instance of ChangeCounter.



4
5
6
# File 'lib/controlled_versioning/change_counter.rb', line 4

def initialize(version)
  @version = version
end

Instance Attribute Details

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/controlled_versioning/change_counter.rb', line 3

def version
  @version
end

Instance Method Details

#countObject



8
9
10
# File 'lib/controlled_versioning/change_counter.rb', line 8

def count
  version.version_attributes.length + changed_child_attributes
end