Class: Ical2gcal::Ics::List
- Inherits:
-
Object
- Object
- Ical2gcal::Ics::List
- Defined in:
- lib/ics/list.rb
Instance Method Summary collapse
- #import(uri = nil) ⇒ Object
-
#initialize(uri = nil) ⇒ List
constructor
A new instance of List.
- #list ⇒ Object
- #with_scheme? ⇒ Boolean
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 |
#list ⇒ Object
21 22 23 |
# File 'lib/ics/list.rb', line 21 def list @icses || [] end |
#with_scheme? ⇒ Boolean
25 26 27 |
# File 'lib/ics/list.rb', line 25 def with_scheme? ( %r!\A[a-z]+://! =~ @uri ) ? true : false end |