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)


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_codeObject

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