Class: ChangeTracker::Child

Inherits:
ChangeTracker show all
Defined in:
lib/controlled_versioning/change_tracker/child.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ChangeTracker

#all, #attributes, #children

Constructor Details

#initialize(version) ⇒ Child

Returns a new instance of Child.



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

def initialize(version)
  @version = version
end

Instance Attribute Details

#versionObject (readonly)

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

#marked_for_removal?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/controlled_versioning/change_tracker/child.rb', line 12

def marked_for_removal?
  version.marked_for_removal?
end

#nameObject



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

def name
  version.association_name
end

#new?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/controlled_versioning/change_tracker/child.rb', line 16

def new?
  version.versionable_id.nil?
end