Class: MedievalLatina::Substring
- Inherits:
-
Object
- Object
- MedievalLatina::Substring
- Defined in:
- lib/medieval_latina.rb
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Returns the value of attribute character.
-
#rest ⇒ Object
readonly
Returns the value of attribute rest.
Instance Method Summary collapse
-
#initialize(text, index) ⇒ Substring
constructor
A new instance of Substring.
- #to_team ⇒ Object
Constructor Details
#initialize(text, index) ⇒ Substring
Returns a new instance of Substring.
192 193 194 195 |
# File 'lib/medieval_latina.rb', line 192 def initialize(text, index) @character = text[index] @rest = text[index + 1..].chars.join end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
190 191 192 |
# File 'lib/medieval_latina.rb', line 190 def character @character end |
#rest ⇒ Object (readonly)
Returns the value of attribute rest.
190 191 192 |
# File 'lib/medieval_latina.rb', line 190 def rest @rest end |
Instance Method Details
#to_team ⇒ Object
197 198 199 |
# File 'lib/medieval_latina.rb', line 197 def to_team :"#{character}#{rest[0]}" end |