Class: ZRB::Buffer
- Inherits:
-
String
- Object
- String
- ZRB::Buffer
- Defined in:
- lib/zrb.rb
Direct Known Subclasses
Instance Method Summary collapse
- #append=(other) ⇒ Object
- #append_string(other) ⇒ Object
- #capture(blk) ⇒ Object
- #escape(other) ⇒ Object
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 |