module Rbexy::ViewContextHelper

Public Instance Methods

rbexy_is_html_safe_array?(value) click to toggle source
# File lib/rbexy/view_context_helper.rb, line 15
def rbexy_is_html_safe_array?(value)
  value.is_a?(Array) && value.all? { |v| v.respond_to?(:html_safe?) && v.html_safe? }
end
rbexy_prep_output(*value) click to toggle source
# File lib/rbexy/view_context_helper.rb, line 7
def rbexy_prep_output(*value)
  return if value.length == 0
  value = value.first

  value = rbexy_is_html_safe_array?(value) ? value.join.html_safe : value
  [nil, false].include?(value) ? "" : value.to_s
end
rbexy_tag() click to toggle source
# File lib/rbexy/view_context_helper.rb, line 3
def rbexy_tag
  @rbexy_tag ||= Runtime.create_tag_builder(self)
end