Class: Wlog::NewEntry

Inherits:
Commandable show all
Defined in:
lib/wlog/commands/new_entry.rb

Overview

Author:

  • Simon Symeonidis

Instance Method Summary collapse

Constructor Details

#initialize(desc, issue) ⇒ NewEntry

Returns a new instance of NewEntry.



11
12
13
# File 'lib/wlog/commands/new_entry.rb', line 11

def initialize(desc, issue)
  @desc, @issue = desc, issue
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
# File 'lib/wlog/commands/new_entry.rb', line 15

def execute
  log_entry = LogEntry.new(
    :description => @desc,
    :created_at => DateTime.now,
    :updated_at => DateTime.now)

  @issue.log_entries << log_entry
end