Class: Keigo

Inherits:
Object
  • Object
show all
Defined in:
lib/keigo.rb

Instance Method Summary collapse

Constructor Details

#initializeKeigo

Returns a new instance of Keigo.



14
15
16
# File 'lib/keigo.rb', line 14

def initialize
  @keigo_henkan = $keigo_henkan
end

Instance Method Details

#k(text) ⇒ Object



22
23
24
25
# File 'lib/keigo.rb', line 22

def k text
  @keigo_henkan.each_key {|key| text = text.sub(key, @keigo_henkan[key])}
  text
end

#sama(name) ⇒ Object



18
19
20
# File 'lib/keigo.rb', line 18

def sama name
  "#{name}"
end