Class: Vpim::Repo::Uri::Calendar
Instance Method Summary collapse
- #body ⇒ Object
-
#displayed ⇒ Object
:nodoc:.
-
#each(klass, &block) ⇒ Object
:nodoc:.
-
#encode ⇒ Object
:nodoc:.
-
#initialize(uri) ⇒ Calendar
constructor
:nodoc:.
-
#name ⇒ Object
:nodoc:.
Methods inherited from Calendar
Constructor Details
Instance Method Details
#body ⇒ Object
203 204 |
# File 'lib/vpim/repo.rb', line 203 def body end |
#displayed ⇒ Object
:nodoc:
214 215 216 |
# File 'lib/vpim/repo.rb', line 214 def displayed #:nodoc: true end |
#each(klass, &block) ⇒ Object
:nodoc:
218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/vpim/repo.rb', line 218 def each(klass, &block) #:nodoc: unless iterator? return Enumerable::Enumerator.new(self, :each, klass) end cals = Vpim::Icalendar.decode(encode) cals.each do |cal| cal.each(klass, &block) end self end |
#encode ⇒ Object
:nodoc:
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/vpim/repo.rb', line 231 def encode #:nodoc: Net::HTTP.get_response(@uri) do |result| accum = "" =begin better to let this pass up as an invalid encoding error if result.code != "200" raise StandardError, "HTTP GET of #{@uri.to_s.inspect} failed with #{result.code} #{result.error_type}" end =end result.read_body do |chunk| accum << chunk end return accum end end |
#name ⇒ Object
:nodoc:
210 211 212 |
# File 'lib/vpim/repo.rb', line 210 def name #:nodoc: @uri.to_s end |