Class: Jinda::JindaHelper::String
- Inherits:
-
Object
- Object
- Jinda::JindaHelper::String
- Defined in:
- app/helpers/jinda_engine/jinda_helper.rb
Overview
Add method to ruby class String ###############################
Instance Method Summary collapse
- #comment? ⇒ Boolean
-
#to_code ⇒ Object
self==35 # check if first char is #.
Instance Method Details
#comment? ⇒ Boolean
721 722 723 724 |
# File 'app/helpers/jinda_engine/jinda_helper.rb', line 721 def comment? self[0]=='#' # self[0]==35 # check if first char is # end |
#to_code ⇒ Object
self==35 # check if first char is #
725 726 727 728 |
# File 'app/helpers/jinda_engine/jinda_helper.rb', line 725 def to_code s= self.dup s.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'') end |