Module: SistemKebut::Remote

Defined in:
lib/sks/remote.rb

Class Method Summary collapse

Class Method Details

.terjemah(jenis) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sks/remote.rb', line 5

def self.terjemah(jenis)
  return jenis if jenis.is_a?(String)
  return jenis.to_s if jenis == :Type
  return jenis.to_s if jenis == :Target
  return jenis.to_s if jenis == :Id
  return jenis.to_s if jenis.to_s[0].ord > 96
  label = case jenis
  when :MEDIA; :GAMBAR_TEXT_MEDIA
  when :BDOC; :GAMBAR_TEXT_BEHINDDOC
  when :DIST_T; :ANCHOR_ATTR_DIST_T
  when :DIST_B; :ANCHOR_ATTR_DIST_B
  when :DIST_L; :ANCHOR_ATTR_DIST_L
  when :DIST_R; :ANCHOR_ATTR_DIST_R
  when :SIMPLE_POS; :ANCHOR_ATTR_SIMPLE_POS
  when :LOCKED; :ANCHOR_ATTR_LOCKED
  when :LAYOUT_IN_CELL; :ANCHOR_ATTR_LAYOUT
  when :ALLOW_OVERLAP; :ANCHOR_ATTR_OVERLAP
  when :RELATIVE_HEIGHT; :ANCHOR_ATTR_REL_HEIGHT
  else; jenis
  end
  @instansi.untaian(label)
end