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.



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

#characterObject (readonly)

Returns the value of attribute character.



159
160
161
# File 'lib/medieval_latina.rb', line 159

def character
  @character
end

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



166
167
168
# File 'lib/medieval_latina.rb', line 166

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