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
13
# 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



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

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

#existsObject



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

def exists
  return @exists
end