Class: ChronicTree::Command::RemoveSelfElement

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ RemoveSelfElement

Returns a new instance of RemoveSelfElement.



141
142
143
# File 'lib/chronic_tree/command.rb', line 141

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



139
140
141
# File 'lib/chronic_tree/command.rb', line 139

def source
  @source
end

Instance Method Details

#doObject



145
146
147
148
149
# File 'lib/chronic_tree/command.rb', line 145

def do
  source.existed_relation(source.current_time_at, source.current_scope_name).each do |el|
    el.update_attribute(:end_time, source.current_time_at)
  end
end