Class: ActionController::StringCoercion::UglyBody

Inherits:
ActiveSupport::BasicObject
Defined in:
lib/action_controller/string_coercion.rb

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ UglyBody

Returns a new instance of UglyBody.



4
5
6
# File 'lib/action_controller/string_coercion.rb', line 4

def initialize(body)
  @body = body
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



15
16
17
# File 'lib/action_controller/string_coercion.rb', line 15

def method_missing(*args, &block)
  @body.__send__(*args, &block)
end

Instance Method Details

#eachObject



8
9
10
11
12
# File 'lib/action_controller/string_coercion.rb', line 8

def each
  @body.each do |part|
    yield part.to_s
  end
end