Class: Tidybuf
- Inherits:
-
Object
- Object
- Tidybuf
- Extended by:
- DL::Importable
- Defined in:
- lib/tidy/tidybuf.rb
Overview
Buffer structure.
Instance Attribute Summary collapse
-
#struct ⇒ Object
readonly
Access TidyBuffer instance.
Instance Method Summary collapse
-
#free ⇒ Object
Free current contents and zero out.
-
#initialize ⇒ Tidybuf
constructor
A new instance of Tidybuf.
-
#to_a ⇒ Object
Convert to array.
-
#to_s ⇒ Object
Convert to string.
Constructor Details
Instance Attribute Details
#struct ⇒ Object (readonly)
Access TidyBuffer instance.
9 10 11 |
# File 'lib/tidy/tidybuf.rb', line 9 def struct @struct end |
Instance Method Details
#free ⇒ Object
Free current contents and zero out.
18 19 20 |
# File 'lib/tidy/tidybuf.rb', line 18 def free Tidylib.buf_free(@struct) end |
#to_a ⇒ Object
Convert to array.
24 25 26 |
# File 'lib/tidy/tidybuf.rb', line 24 def to_a to_s.split($/) end |
#to_s ⇒ Object
Convert to string.
30 31 32 |
# File 'lib/tidy/tidybuf.rb', line 30 def to_s @struct.bp ? @struct.bp.to_s(@struct.size) : '' end |