Class: BaseHex

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

Overview

This is the base hexagon class designed to be derived into axial and cube hexagons. Sould never been instancied.

Direct Known Subclasses

AxialHex, CubeHex

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(color = nil, border = nil, data = nil) ⇒ BaseHex

Returns a new instance of BaseHex.



11
12
13
14
15
# File 'lib/hex/base_hex.rb', line 11

def initialize( color = nil, border = nil, data = nil )
  @color = color
  @border = border
  @data = data
end

Instance Attribute Details

#borderObject

Returns the value of attribute border.



9
10
11
# File 'lib/hex/base_hex.rb', line 9

def border
  @border
end

#colorObject

Returns the value of attribute color.



9
10
11
# File 'lib/hex/base_hex.rb', line 9

def color
  @color
end

#dataObject

Returns the value of attribute data.



9
10
11
# File 'lib/hex/base_hex.rb', line 9

def data
  @data
end

#isBoolean (readonly)

the hexagon cut by the border of the picture

Returns:

  • (Boolean)

    the current value of is



8
9
10
# File 'lib/hex/base_hex.rb', line 8

def is
  @is
end

#theString (readonly)

color of the hexagon an ImageMagic compatible string

Returns:

  • (String)

    the current value of the



8
9
10
# File 'lib/hex/base_hex.rb', line 8

def the
  @the
end

#yourObject (readonly)

data, anything you want

Returns:

  • (Object)

    the current value of your



8
9
10
# File 'lib/hex/base_hex.rb', line 8

def your
  @your
end