Class: Spanish::Syllable::Syllables
- Inherits:
-
Object
- Object
- Spanish::Syllable::Syllables
- Includes:
- Enumerable
- Defined in:
- lib/spanish/syllable.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#sounds ⇒ Object
readonly
Returns the value of attribute sounds.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(sounds) ⇒ Syllables
constructor
A new instance of Syllables.
Constructor Details
#initialize(sounds) ⇒ Syllables
Returns a new instance of Syllables.
110 111 112 |
# File 'lib/spanish/syllable.rb', line 110 def initialize(sounds) @sounds = sounds end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
108 109 110 |
# File 'lib/spanish/syllable.rb', line 108 def index @index end |
#sounds ⇒ Object (readonly)
Returns the value of attribute sounds.
108 109 110 |
# File 'lib/spanish/syllable.rb', line 108 def sounds @sounds end |
Instance Method Details
#each(&block) ⇒ Object
114 115 116 117 118 119 120 121 122 |
# File 'lib/spanish/syllable.rb', line 114 def each(&block) begin sounds.each_index { |i| @index = i; append or do_yield(&block) } do_yield(&block) ensure @index = 0 @syllable = nil end end |