Class: Ical2gcal::Ics::List

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

Instance Method Summary collapse

Constructor Details

#initialize(uri = nil) ⇒ List

Returns a new instance of List.



8
9
10
11
# File 'lib/ics/list.rb', line 8

def initialize( uri = nil )
  @uri   ||= uri
  @icses =   nil
end

Instance Method Details

#import(uri = nil) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/ics/list.rb', line 13

def import( uri = nil )
  @uri = uri if uri

  if ( @uri )
    @icses = open( @uri ).read.split( /[\r\n]+/ )
  end
end

#listObject



21
22
23
# File 'lib/ics/list.rb', line 21

def list
  @icses || []
end

#with_scheme?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ics/list.rb', line 25

def with_scheme?
  ( %r!\A[a-z]+://! =~ @uri ) ? true : false
end