Class: Backlog::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/backlog/file.rb,
lib/backlog/entry.rb

Instance Method Summary collapse

Constructor Details

#initialize(date) ⇒ Entry

Returns a new instance of Entry.



3
4
5
6
7
8
9
10
11
12
# File 'lib/backlog/entry.rb', line 3

def initialize(date)
  @date = date
  @path = date.path
  if not File.exists?(date.path)
    @exists = nil
  else
    @exists = true
  end

end

Instance Method Details

#createObject



18
19
20
21
22
23
# File 'lib/backlog/entry.rb', line 18

def create
  File.open(@path, "w") do |f|
    f.write content
  end
  
end

#existsObject



14
15
16
# File 'lib/backlog/entry.rb', line 14

def exists
  return @exists
end