Class: Jinda::Helpers::String
- Inherits:
-
Object
- Object
- Jinda::Helpers::String
- Defined in:
- lib/jinda/helpers.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
577 578 579 580 |
# File 'lib/jinda/helpers.rb', line 577 def comment? self[0]=='#' # self[0]==35 # check if first char is # end |
#to_code ⇒ Object
self==35 # check if first char is #
581 582 583 584 |
# File 'lib/jinda/helpers.rb', line 581 def to_code s= self.dup s.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'') end |