Class: RubyAnything::Text
- Inherits:
-
Object
- Object
- RubyAnything::Text
- Defined in:
- lib/ruby-anything/text.rb
Instance Method Summary collapse
- #delete(index) ⇒ Object
-
#initialize ⇒ Text
constructor
A new instance of Text.
- #insert(index, ch) ⇒ Object
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Text
Returns a new instance of Text.
5 6 7 |
# File 'lib/ruby-anything/text.rb', line 5 def initialize @io = [] end |
Instance Method Details
#delete(index) ⇒ Object
21 22 23 |
# File 'lib/ruby-anything/text.rb', line 21 def delete(index) @io.delete_at index end |
#insert(index, ch) ⇒ Object
17 18 19 |
# File 'lib/ruby-anything/text.rb', line 17 def insert(index, ch) @io.insert index, ch end |
#to_a ⇒ Object
9 10 11 |
# File 'lib/ruby-anything/text.rb', line 9 def to_a @io end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/ruby-anything/text.rb', line 13 def to_s @io.join('') end |