Module: Gast::Helper

Included in:
Memo
Defined in:
lib/gast/helper.rb

Instance Method Summary collapse

Instance Method Details

#escape_htmlObject


5
6
7
# File 'lib/gast/helper.rb', line 5

def escape_html
  CGI.escapeHTML(yield.to_s) if block_given?
end

#get_content(id) ⇒ Object


13
14
15
# File 'lib/gast/helper.rb', line 13

def get_content(id)
  File.read(File.expand_path(Gast::PATH + "/#{id}/content"))
end

#get_language(id) ⇒ Object


17
18
19
# File 'lib/gast/helper.rb', line 17

def get_language(id)
  File.read(File.expand_path(Gast::PATH + "/#{id}/language"))
end

#unescape_htmlObject


9
10
11
# File 'lib/gast/helper.rb', line 9

def unescape_html
  CGI.unescapeHTML(yield.to_s) if block_given?
end