Class: Googlecalendar::TextBuilder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#calendarObject

Returns the value of attribute calendar.



5
6
7
# File 'lib/googlecalendar_builders.rb', line 5

def calendar
  @calendar
end

#filenameObject

Returns the value of attribute filename.



5
6
7
# File 'lib/googlecalendar_builders.rb', line 5

def filename
  @filename
end

Instance Method Details

#exportObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/googlecalendar_builders.rb', line 7

def export
  begin
    File.delete(@filename)
  rescue
    # if doesn't exist
  end
  File.open(@filename, File::CREAT|File::RDWR) do |file|
    file << calendar.to_s
  end
end