module WrapIt::Renderer

Non rails render implementation

Provides render function for Rails

@author Alexey Ovchinnikov <alexiss@cybernetlab.ru>

Public Class Methods

included(base) click to toggle source
# File lib/wrap_it/no_rails.rb, line 35
def self.included(base)
  base == Base || fail(
    TypeError,
    "#{self.class.name} can be included only into WrapIt::Base"
  )
end

Protected Instance Methods

capture(text = nil) { |: text| ... } click to toggle source
# File lib/wrap_it/no_rails.rb, line 48
def capture(text = nil)
  block_given? ? yield : text
end
concat(text) click to toggle source
# File lib/wrap_it/no_rails.rb, line 52
def concat(text)
  @buffer ||= empty_html
  @buffer << text
end
content_tag(tag, body, options = {}) click to toggle source
# File lib/wrap_it/no_rails.rb, line 61
def content_tag(tag, body, options = {})
  arr = [tag]
  options.each { |o, v| arr << "#{o}=\"#{v.to_s}\"" }
  "<#{arr.join(' ')}>#{body}</#{tag}>"
end
empty_html() click to toggle source
# File lib/wrap_it/no_rails.rb, line 44
def empty_html
  ''
end
html_safe(text) click to toggle source
# File lib/wrap_it/no_rails.rb, line 67
def html_safe(text)
  text
end
html_safe?(text) click to toggle source
# File lib/wrap_it/no_rails.rb, line 71
def html_safe?(text)
  true
end
output_buffer() click to toggle source
# File lib/wrap_it/no_rails.rb, line 57
def output_buffer
  @buffer
end
superhtml(text) click to toggle source
# File lib/wrap_it/rails.rb, line 29
def superhtml(text)
  text.to_s
end