Module: CmGem

Defined in:
lib/cm_gem.rb,
lib/cm_gem/version.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

VERSION =
"0.1.4"

Instance Method Summary collapse

Instance Method Details

#capitalize(name) ⇒ Object



40
41
42
# File 'lib/cm_gem.rb', line 40

def capitalize(name)
  puts name.capitalize()
end

#centerPad(chars, filler = " ") ⇒ Object



20
21
22
# File 'lib/cm_gem.rb', line 20

def centerPad(chars,filler=" ")
  self.center(chars,filler)
end

#emailValid(email) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/cm_gem.rb', line 24

def emailValid(email)
    if email.match?("^(?=.{1,64}@)[\\p{L}0-9_-]+(\\.[\\p{L}0-9_-]+)*@[^-][\\p{L}0-9-]+(\\.[\\p{L}0-9-]+)*(\\.[\\p{L}]{2,})$")
      puts 'matches!'
    else
      puts 'it doesn\'t match!'
    end
end

#leftPad(chars, filler = " ") ⇒ Object



12
13
14
# File 'lib/cm_gem.rb', line 12

def leftPad(chars,filler=" ")
  self.rjust(chars,filler)
end

Your code goes here…



8
9
10
# File 'lib/cm_gem.rb', line 8

def print
  puts "hello from cm!!!"
end

#rightPad(chars, filler = " ") ⇒ Object



16
17
18
# File 'lib/cm_gem.rb', line 16

def rightPad(chars,filler=" ")
  self.ljust(chars,filler)
end

#toLower(name) ⇒ Object



36
37
38
# File 'lib/cm_gem.rb', line 36

def toLower(name)
  puts name.downcase
end

#toUpper(name) ⇒ Object



32
33
34
# File 'lib/cm_gem.rb', line 32

def toUpper(name)
  puts name.upcase
end