Class: Vpim::Repo::Uri
- Inherits:
-
Vpim::Repo
- Object
- Vpim::Repo
- Vpim::Repo::Uri
- Defined in:
- lib/vpim/repo.rb
Defined Under Namespace
Classes: Calendar
Class Method Summary collapse
Instance Method Summary collapse
-
#each {|Calendar.new(@where)| ... } ⇒ Object
:nodoc:.
-
#initialize(where) ⇒ Uri
constructor
A new instance of Uri.
Constructor Details
Class Method Details
.uri_check(uri) ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/vpim/repo.rb', line 185 def self.uri_check(uri) uri = case uri when URI uri else begin URI.parse(uri.sub(/^webcal:/, "http:")) rescue URI::InvalidURIError => e raise ArgumentError, "Invalid URI for #{uri.inspect} - #{e.to_s}" end end unless uri.scheme == "http" raise ArgumentError, "Unsupported URI scheme for #{uri.inspect}" end uri end |