Module: TreasureData::API::DeflateReadBodyMixin
- Defined in:
- lib/td/client/api.rb
Instance Attribute Summary collapse
-
#gzip ⇒ Object
Returns the value of attribute gzip.
Instance Method Summary collapse
Instance Attribute Details
#gzip ⇒ Object
Returns the value of attribute gzip.
1078 1079 1080 |
# File 'lib/td/client/api.rb', line 1078 def gzip @gzip end |
Instance Method Details
#each_fragment(&block) ⇒ Object
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 |
# File 'lib/td/client/api.rb', line 1080 def each_fragment(&block) if @gzip infl = Zlib::Inflate.new(Zlib::MAX_WBITS+16) else infl = Zlib::Inflate.new end begin read_body do |fragment| block.call infl.inflate(fragment) end ensure infl.close end nil end |