class ActionView::OutputBuffer

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/action_view/buffers.rbs

class ActionView::OutputBuffer
  def <<: ((String | ActiveSupport::SafeBuffer) value) -> ActionView::OutputBuffer
  def capture: (*Array[] args) -> ActiveSupport::SafeBuffer
  def initialize: (?String buffer) -> void
  def safe_concat: (String value) -> ActionView::OutputBuffer
  def to_s: () -> ActiveSupport::SafeBuffer
end

:nodoc:
puts sbuf # => “hellou0005”
sbuf << 5
sbuf = ActiveSupport::SafeBuffer.new “hello”
puts obuf # => “hello5”
obuf << 5
obuf = ActionView::OutputBuffer.new “hello”
the input. For example:
checked for nil before they are assigned and ‘to_s` is called on
is for the methods `<<` and `safe_expr_append=` the inputs are
The main difference between this and ActiveSupport::SafeBuffer
Used as a buffer for views

def <<(value)

Experimental RBS support (using type sampling data from the type_fusion project).

def <<: ((String | ActiveSupport::SafeBuffer) value) -> ActionView::OutputBuffer

This signature was generated using 10 samples from 1 application.

def <<(value)
  unless value.nil?
    value = value.to_s
    @raw_buffer << if value.html_safe?
      value
    else
      CGI.escapeHTML(value)
    end
  end
  self
end

def ==(other)

def ==(other)
  other.class == self.class && @raw_buffer == other.to_str
end

def capture(*args)

Experimental RBS support (using type sampling data from the type_fusion project).

def capture: (* args) -> ActiveSupport::SafeBuffer

This signature was generated using 4 samples from 1 application.

def capture(*args)
  new_buffer = +""
  old_buffer, @raw_buffer = @raw_buffer, new_buffer
  yield(*args)
  new_buffer.html_safe
ensure
  @raw_buffer = old_buffer
end

def html_safe?

def html_safe?
  true
end

def initialize(buffer = "")

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (?String buffer) -> void

This signature was generated using 3 samples from 1 application.

:nodoc:

puts sbuf # => "hello\u0005"
sbuf << 5
sbuf = ActiveSupport::SafeBuffer.new "hello"

puts obuf # => "hello5"
obuf << 5
obuf = ActionView::OutputBuffer.new "hello"

the input. For example:
checked for nil before they are assigned and `to_s` is called on
is for the methods `<<` and `safe_expr_append=` the inputs are
The main difference between this and ActiveSupport::SafeBuffer

Used as a buffer for views
def initialize(buffer = "")
  @raw_buffer = String.new(buffer)
  @raw_buffer.encode!
end

def initialize_copy(other)

def initialize_copy(other)
  @raw_buffer = other.to_str
end

def raw

def raw
  RawOutputBuffer.new(self)
end

def safe_concat(value)

Experimental RBS support (using type sampling data from the type_fusion project).

def safe_concat: (String value) -> ActionView::OutputBuffer

This signature was generated using 14 samples from 1 application.

def safe_concat(value)
  @raw_buffer << value
  self
end

def safe_expr_append=(val)

def safe_expr_append=(val)
  return self if val.nil?
  @raw_buffer << val.to_s
  self
end

def to_s

Experimental RBS support (using type sampling data from the type_fusion project).

def to_s: () -> ActiveSupport::SafeBuffer

This signature was generated using 1 sample from 1 application.

def to_s
  @raw_buffer.html_safe
end

def to_str

def to_str
  @raw_buffer.dup
end