Class: PolybiusSquare::AlphaList

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ AlphaList

Returns a new instance of AlphaList.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/alpha_list.rb', line 6

def initialize(options={})
  offset = options[:offset]
  dropped = options[:dropped]

  @list = %w[ a b c d e f g h i j k l m n o p q r s t u v w x y z ]
  @list.delete(dropped)

  if offset
    shifted = list.shift(offset)
    @list = list + shifted
  end

end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



4
5
6
# File 'lib/alpha_list.rb', line 4

def list
  @list
end