Class: Amaze::Shape

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

Direct Known Subclasses

Diamond, Hexagon, Star, Triangle

Defined Under Namespace

Classes: Diamond, Hexagon, Star, Triangle

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size) ⇒ Shape

Returns a new instance of Shape.



11
12
13
# File 'lib/amaze/shape.rb', line 11

def initialize size
  @size = size
end

Instance Attribute Details

#sizeObject (readonly)

The size of the shape, usually the rows



9
10
11
# File 'lib/amaze/shape.rb', line 9

def size
  @size
end

Instance Method Details

#create_maskObject



19
20
21
22
# File 'lib/amaze/shape.rb', line 19

def create_mask
  build_mask
  mask
end

#maskObject



15
16
17
# File 'lib/amaze/shape.rb', line 15

def mask
  @mask ||= Amaze::Mask.new rows, columns
end