Class: ZRB::Buffer

Inherits:
String
  • Object
show all
Defined in:
lib/zrb.rb

Direct Known Subclasses

HTMLBuffer

Instance Method Summary collapse

Instance Method Details

#append=(other) ⇒ Object



163
164
165
# File 'lib/zrb.rb', line 163

def append=(other)
  self << escape(other)
end

#append_string(other) ⇒ Object



167
168
169
# File 'lib/zrb.rb', line 167

def append_string(other)
  self << other
end

#capture(blk) ⇒ Object



171
172
173
174
175
176
# File 'lib/zrb.rb', line 171

def capture(blk)
  start = self.size
  blk.call
ensure
  return self.slice!(start..-1)
end

#escape(other) ⇒ Object



159
160
161
# File 'lib/zrb.rb', line 159

def escape(other)
  other.to_s
end