Class: IcsParser

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(calendar_content) ⇒ IcsParser

Returns a new instance of IcsParser.



12
13
14
# File 'lib/ics_parser.rb', line 12

def initialize(calendar_content)
  @calendar_content = calendar_content
end

Class Method Details

.from_file(file) ⇒ Object



4
5
6
# File 'lib/ics_parser.rb', line 4

def self.from_file(file)
  from_string(File.read(file))
end

.from_string(text) ⇒ Object



8
9
10
# File 'lib/ics_parser.rb', line 8

def self.from_string(text)
  return IcsParser.new(text)
end

Instance Method Details

#eventsObject



16
17
18
# File 'lib/ics_parser.rb', line 16

def events
  EventParser.new(@calendar_content).events
end