class Oneday::Command::Oneday

Public Instance Methods

hello(name = "teddy") click to toggle source
# File lib/oneday/command/oneday.rb, line 7
def hello(name = "teddy")
  puts "Hello #{name}"
end
list() click to toggle source
# File lib/oneday/command/oneday.rb, line 24
def list
  Note.new(content: "demo").save
  notes = Note.all
  puts notes.inspect
end
record(content) click to toggle source
# File lib/oneday/command/oneday.rb, line 13
def record(content)
  puts "I will record #{content} with project #{options[:project]}"
  project = Project.where(name: options[:project]).first || Project.create(name: options[:project])
  note = Note.new(content: content)
  note.save
  project.add_note(note)
  notes = Note.all
  puts notes.inspect
end