Class: JHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/ontomde-uml2-java/javaHelper.rb

Class Method Summary collapse

Class Method Details

.to_firstUpper(name) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/ontomde-uml2-java/javaHelper.rb', line 2

def JHelper.to_firstUpper(name)
  result = String.new(name)
  if !result.empty?
    result[0] = result[0, 1].upcase
  end
  return result
end

.to_NameProperty(name) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/ontomde-uml2-java/javaHelper.rb', line 9

def JHelper.to_NameProperty(name)
  result = String.new(name)
  if !result.empty?
    result[0] = result[0, 1].downcase
  end
  return result
end

.to_SingleName(name) ⇒ Object

remove the last caracter if ā€˜sā€™



17
18
19
20
21
22
23
# File 'lib/ontomde-uml2-java/javaHelper.rb', line 17

def JHelper.to_SingleName(name)
  result = String.new(name)
  if !result.empty? && result[result.size-1]==115 #'s'
    result = result[0, result.size - 1]
  end
  return result
end