Class: Pinyin::Syllable

Inherits:
TonelessSyllable show all
Defined in:
lib/pinyin/groundwork.rb

Overview

Syllable : initial, final and tone

Instance Attribute Summary collapse

Attributes inherited from TonelessSyllable

#final, #initial

Instance Method Summary collapse

Methods inherited from TonelessSyllable

#+, illegal?

Constructor Details

#initialize(initial, final, tone) ⇒ Syllable

Returns a new instance of Syllable.



117
118
119
120
# File 'lib/pinyin/groundwork.rb', line 117

def initialize(initial, final, tone)
  super(initial, final)
  self.tone = tone
end

Instance Attribute Details

#toneObject

Returns the value of attribute tone.



115
116
117
# File 'lib/pinyin/groundwork.rb', line 115

def tone
  @tone
end

Instance Method Details

#inspectObject Also known as: to_s



122
123
124
# File 'lib/pinyin/groundwork.rb', line 122

def inspect
  "<#{self.class.name} <initial=#{initial.name}, final=#{final.name}, tone=#{tone}>>"
end