Sha256: b39b9e619c3a1b0d574dfd3ce8ac99516c6abfcd2c8ce1ff059c65e21768419d

Contents?: true

Size: 612 Bytes

Versions: 1

Compression:

Stored size: 612 Bytes

Contents

class Html_gen::Text_ele
  attr_reader :args
  
  def initialize(args)
    @str = args[:str]
    @inden = args[:inden]
    @nl = args[:nl]
  end
  
  #Returns the text that this element holds.
  def str
    return @str
  end
  
  #Returns the text HTML-escaped.
  def html(args)
    if args[:level]
      level = args[:level]
    else
      level = 0
    end
    
    if !args.key?(:pretty) or args[:pretty]
      pretty = true
    else
      pretty = false
    end
    
    str = ""
    str << @inden * level if pretty
    str << Html_gen.escape_html(@str)
    str << @nl if pretty
    
    return str
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
html_gen-0.0.5 lib/html_gen_text_ele.rb