Class: TwistyPuzzles::Edge

Inherits:
Part
  • Object
show all
Extended by:
EdgeLike
Defined in:
lib/twisty_puzzles/cube.rb

Overview

Represents one edge or the position of one edge on the cube.

Constant Summary collapse

FACES =
2
ELEMENTS =
generate_parts

Constants included from CubeConstants

CubeConstants::ALPHABET_SIZE, CubeConstants::CHIRALITY_FACE_SYMBOLS, CubeConstants::FACE_NAMES, CubeConstants::FACE_SYMBOLS, CubeConstants::OPPOSITE_FACE_SYMBOLS, CubeConstants::SKEWB_STICKERS

Instance Attribute Summary

Attributes inherited from Part

#face_symbols, #piece_index

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EdgeLike

valid?

Methods inherited from Part

#<=>, #base_index_on_face, #corresponding_part, #eql?, exists_on_cube_size?, exists_on_odd_cube_sizes?, #faces, for_face_symbols, for_face_symbols_internal, for_index, generate_parts, #hash, #initialize, #inspect, max_parseable_face_symbols, min_parseable_face_symbols, #mirror, parse, #rotate_by, #rotate_by_rotation, #rotate_face_symbol_up, #rotate_face_up, #rotations, #solved_coordinate, #solved_face, #to_s, #turned_equals?, valid?

Methods included from Utils::ArrayHelper

#apply_permutation, #check_types, #find_only, #only, #replace_once, #rotate_out_nils, #turned_equals?

Methods included from CubeConstants

#chirality_canonical_face_symbol, #opposite_face_symbol, #valid_chirality?

Constructor Details

This class inherits a constructor from TwistyPuzzles::Part

Class Method Details

.exists_on_even_cube_sizes?Boolean

Returns:

  • (Boolean)


462
463
464
# File 'lib/twisty_puzzles/cube.rb', line 462

def self.exists_on_even_cube_sizes?
  false
end

.max_cube_sizeObject



458
459
460
# File 'lib/twisty_puzzles/cube.rb', line 458

def self.max_cube_size
  3
end

.min_cube_sizeObject



454
455
456
# File 'lib/twisty_puzzles/cube.rb', line 454

def self.min_cube_size
  3
end

Instance Method Details

#base_index_on_other_face(_face, _cube_size, _incarnation_index) ⇒ Object

One index of such a piece on a on a NxN face.



472
473
474
# File 'lib/twisty_puzzles/cube.rb', line 472

def base_index_on_other_face(_face, _cube_size, _incarnation_index)
  [0, 1]
end

#num_incarnations(cube_size) ⇒ Object

Edges on uneven bigger cubes are midges, so edges only exist for 3x3.



467
468
469
# File 'lib/twisty_puzzles/cube.rb', line 467

def num_incarnations(cube_size)
  cube_size == 3 ? 1 : 0
end