Class: Jinda::JindaHelper::String

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/jinda_engine/jinda_helper.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#comment?Boolean

Returns:

  • (Boolean)


721
722
723
724
# File 'app/helpers/jinda_engine/jinda_helper.rb', line 721

def comment?
  self[0]=='#'
  # self[0]==35 # check if first char is #
end

#to_codeObject

self==35 # check if first char is #



725
726
727
728
# File 'app/helpers/jinda_engine/jinda_helper.rb', line 725

def to_code
  s= self.dup
  s.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'')
end