Module: Gast::Helper
- Included in:
- Memo
- Defined in:
- lib/gast/helper.rb
Instance Method Summary collapse
- #escape_html ⇒ Object
- #get_content(id) ⇒ Object
- #get_content_dir(id) ⇒ Object
- #get_language(id) ⇒ Object
- #unescape_html ⇒ Object
Instance Method Details
#escape_html ⇒ Object
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.(Gast::PATH + "/#{id}/content")) end |
#get_content_dir(id) ⇒ Object
17 18 19 |
# File 'lib/gast/helper.rb', line 17 def get_content_dir(id) File.(Gast::PATH + "/#{id}") end |
#get_language(id) ⇒ Object
21 22 23 |
# File 'lib/gast/helper.rb', line 21 def get_language(id) File.read(File.(Gast::PATH + "/#{id}/language")) end |
#unescape_html ⇒ Object
9 10 11 |
# File 'lib/gast/helper.rb', line 9 def unescape_html CGI.unescapeHTML(yield.to_s) if block_given? end |