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.



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

#characterObject (readonly)

Returns the value of attribute character.



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

def character
  @character
end

#restObject (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_teamObject



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

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