Module: Schatter::Index
- Included in:
- Command::DeleteMessage, Command::JoinConversation, Command::ListConversations, Command::ListMessages, Command::ReplyToMessage
- Defined in:
- lib/schatter/index.rb
Constant Summary collapse
- LETTERS =
%w{a b c d e f g h i j}
Instance Method Summary collapse
Instance Method Details
#from_index(string) ⇒ Object
8 9 10 |
# File 'lib/schatter/index.rb', line 8 def from_index string string.scan(/./).map{|c| LETTERS.index c}.join.to_i end |
#to_index(number) ⇒ Object
4 5 6 |
# File 'lib/schatter/index.rb', line 4 def to_index number number.to_s.scan(/./).map{|c| LETTERS[c.to_i]}.join('') end |