Class: Hawaiian
- Inherits:
-
Object
- Object
- Hawaiian
- Defined in:
- lib/hawaiian.rb
Constant Summary collapse
- @@character_substitutions =
{ "ʻ" => "‘", "ā" => "ā", "ē" => "ē", "ī" => "ī", "ō" => "ō", "ū" => "ū", "Ā" => "Ā", "Ē" => "Ē", "Ī" => "Ī", "Ō" => "Ō", "Ū" => "Ū", "ō" => "ō", "ā" => "ā", "Ō" => "Ō", }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Hawaiian
constructor
A new instance of Hawaiian.
Constructor Details
#initialize ⇒ Hawaiian
Returns a new instance of Hawaiian.
19 20 |
# File 'lib/hawaiian.rb', line 19 def initialize end |
Class Method Details
.encode_html(text) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/hawaiian.rb', line 29 def self.encode_html( text ) @@character_substitutions.each do |haw,code| text.gsub!(haw,code) end text end |
.hawaiian?(text) ⇒ Boolean
22 23 24 25 26 27 |
# File 'lib/hawaiian.rb', line 22 def self.hawaiian?( text ) @@character_substitutions.each do |haw,code| return true if text.include?( haw ) end return false end |