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.
161 162 163 164 |
# File 'lib/medieval_latina.rb', line 161 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.
159 160 161 |
# File 'lib/medieval_latina.rb', line 159 def character @character end |
#rest ⇒ Object (readonly)
Returns the value of attribute rest.
159 160 161 |
# File 'lib/medieval_latina.rb', line 159 def rest @rest end |
Instance Method Details
#to_team ⇒ Object
166 167 168 |
# File 'lib/medieval_latina.rb', line 166 def to_team "#{character}#{rest[0]}".intern end |