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