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.



202
203
204
205
# File 'lib/medieval_latina.rb', line 202

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.



200
201
202
# File 'lib/medieval_latina.rb', line 200

def character
  @character
end

#restObject (readonly)

Returns the value of attribute rest.



200
201
202
# File 'lib/medieval_latina.rb', line 200

def rest
  @rest
end

Instance Method Details

#to_teamObject



207
208
209
# File 'lib/medieval_latina.rb', line 207

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