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
204 205 |
# File 'lib/vpim/repo.rb', line 204 def body end |
#displayed ⇒ Object
:nodoc:
215 216 217 |
# File 'lib/vpim/repo.rb', line 215 def displayed #:nodoc: true end |
#each(klass, &block) ⇒ Object
:nodoc:
219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/vpim/repo.rb', line 219 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:
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/vpim/repo.rb', line 232 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:
211 212 213 |
# File 'lib/vpim/repo.rb', line 211 def name #:nodoc: @uri.to_s end |