class String

Public Instance Methods

to_bool() click to toggle source
# File lib/protk/psm.rb, line 9
def to_bool
  return true if self == true || self =~ (/^(true|t|yes|y|1)$/i)
  return false if self == false || self =~ (/^(false|f|no|n|0)$/i)
  raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
end
xtandem_modification_motif?() click to toggle source
# File lib/protk/tandem_search_tool.rb, line 5
def xtandem_modification_motif?
              # 124@[ is not a modification motif, it is a residue (N-term) modification,
              # so when checking if modification is a motif look for paired square brackets.
              ismotif=false
              case self
              when /[\(\)\{\}\!]/,/\[.*\]/
                      ismotif=true
              end
              ismotif
end