Class: Pslm::Psalm::Syllable
- Inherits:
-
String
- Object
- String
- Pslm::Psalm::Syllable
- Defined in:
- lib/pslm/psalm.rb
Instance Method Summary collapse
- #==(s2) ⇒ Object
- #accent? ⇒ Boolean
-
#initialize(chars, accent = false) ⇒ Syllable
constructor
A new instance of Syllable.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(chars, accent = false) ⇒ Syllable
Returns a new instance of Syllable.
126 127 128 129 |
# File 'lib/pslm/psalm.rb', line 126 def initialize(chars, accent=false) super(chars) @accent = accent end |
Instance Method Details
#==(s2) ⇒ Object
135 136 137 |
# File 'lib/pslm/psalm.rb', line 135 def ==(s2) s2.is_a? Syllable and (self.to_s == s2.to_s) and (self.accent? == s2.accent?) end |
#accent? ⇒ Boolean
131 132 133 |
# File 'lib/pslm/psalm.rb', line 131 def accent? @accent end |
#inspect ⇒ Object
143 144 145 146 |
# File 'lib/pslm/psalm.rb', line 143 def inspect accent = @accent ? ' accent' : '' return '#' + "<#{self.class}:#{self.object_id} \"#{self}\"#{accent}>" end |
#to_s ⇒ Object
139 140 141 |
# File 'lib/pslm/psalm.rb', line 139 def to_s String.new self end |