Class: Jinda::Helpers::String

Inherits:
Object
  • Object
show all
Defined in:
lib/jinda/helpers.rb

Overview

Add method to ruby class String ###############################

Instance Method Summary collapse

Instance Method Details

#comment?Boolean

Returns:

  • (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_codeObject

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