Class: MedievalLatina::Substring

Inherits:
Object
  • Object
show all
Defined in:
lib/medieval_latina.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, index) ⇒ Substring

Returns a new instance of Substring.



191
192
193
194
# File 'lib/medieval_latina.rb', line 191

def initialize(text, index)
  @character = text[index]
  @rest = text[index + 1..].chars.join
end

Instance Attribute Details

#characterObject (readonly)

Returns the value of attribute character.



189
190
191
# File 'lib/medieval_latina.rb', line 189

def character
  @character
end

#restObject (readonly)

Returns the value of attribute rest.



189
190
191
# File 'lib/medieval_latina.rb', line 189

def rest
  @rest
end

Instance Method Details

#to_teamObject



196
197
198
# File 'lib/medieval_latina.rb', line 196

def to_team
  :"#{character}#{rest[0]}"
end