Class: RubyAnything::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-anything/text.rb

Instance Method Summary collapse

Constructor Details

#initializeText

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_aObject



9
10
11
# File 'lib/ruby-anything/text.rb', line 9

def to_a
  @io
end

#to_sObject



13
14
15
# File 'lib/ruby-anything/text.rb', line 13

def to_s
  @io.join('')
end