Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/jinda/gen_class.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
5 6 7 8 |
# File 'lib/jinda/gen_class.rb', line 5 def comment? self[0]=='#' # self[0]==35 # check if first char is # end |
#to_code ⇒ Object
self==35 # check if first char is #
9 10 11 12 |
# File 'lib/jinda/gen_class.rb', line 9 def to_code s= self.dup s.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'') end |