Sha256: 2b51215d4c75557514682f9d072749350a659e9fce3fd2a6d2a0f1d87b6786a6
Contents?: true
Size: 727 Bytes
Versions: 2
Compression:
Stored size: 727 Bytes
Contents
module EventMachine module Twitter class Response attr_reader :body def initialize(body = '') @body = body end def concat(data) return unless data && data.size > 0 data.strip! return if data.empty? if json_start?(data) || json_end?(data) @body << data end end alias :<< :concat def complete? json_start?(@body) && json_end?(@body) end def empty? @body == '' end def reset @body = '' end private def json_start?(data) data[0,1] == '{' end def json_end?(data) data[data.length-1,1] == '}' end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
em-twitter-0.1.1 | lib/em-twitter/response.rb |
em-twitter-0.1.0 | lib/em-twitter/response.rb |