Class: Bauxite::Context::StringIOProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/bauxite/core/context.rb

Overview

Same as a common StringIO except that get(sep) returns a StringProxy instead of a regular string.

Instance Method Summary collapse

Constructor Details

#initialize(s) ⇒ StringIOProxy

:nodoc:



779
780
781
# File 'lib/bauxite/core/context.rb', line 779

def initialize(s)
  @s = StringIO.new(s)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



783
784
785
786
787
# File 'lib/bauxite/core/context.rb', line 783

def method_missing(method, *args, &block)
  ret = @s.send(method, *args, &block)
  return ret unless method == :gets and args.size == 1
  StringProxy.new(ret)
end