module WrapIt::TextContainer::ClassMethods

Public Instance Methods

html_safe(value = nil) click to toggle source

Sets whether text from arguments are html-safe @param value [Boolean] `true` means that text from arguments have

proper markup and component will mark it as save via html_safe
method. `flase` means, that this values can contain unsafe content,
so user should make html-safe string by itself.

@return [Boolean] current value

# File lib/wrap_it/text_container.rb, line 84
def html_safe(value = nil)
  if value.nil?
    @html_safe.nil? && @html_safe = true
    @html_safe
  else
    @html_safe = value == true
  end
end
html_safe?() click to toggle source

Retrieves whether text from attributes are html-safe

@return [Boolean] current value

# File lib/wrap_it/text_container.rb, line 97
def html_safe?
  @html_safe.nil? && @html_safe = true
  @html_safe
end
text_in_block(value = nil) click to toggle source

Sets priotiy of text source

@param value [Boolean] `true` means if block present - text will

be captured from there. `false` means first to inspect arguments and
options and if it ommited retirieve text from block.

@return [Boolean] current value

# File lib/wrap_it/text_container.rb, line 58
def text_in_block(value = nil)
  if value.nil?
    @text_in_block.nil? && @text_in_block = true
    @text_in_block
  else
    @text_in_block = value == true
  end
end
text_in_block?() click to toggle source

Retrieves block priority

@return [Boolean] current value

# File lib/wrap_it/text_container.rb, line 71
def text_in_block?
  @text_in_block.nil? && @text_in_block = true
  @text_in_block
end