Class: CaTissue::Capacity

Inherits:
Object
  • Object
show all
Defined in:
lib/catissue/domain/capacity.rb

Instance Method Summary collapse

Instance Method Details

#boundsObject

Returns the read-only Coordinate with this capacity’s rows and columns.



26
27
28
# File 'lib/catissue/domain/capacity.rb', line 26

def bounds
  @bounds ||= Coordinate.new(columns, rows)
end

#one_dimension_capacity=(value) ⇒ Object

Sets the first dimension to the specified value. If value is nil, then the dimension is set to default one.



6
7
8
9
10
# File 'lib/catissue/domain/capacity.rb', line 6

def one_dimension_capacity=(value)
   # update the bounds as well
  bounds.x = value ||= 1
  setOneDimensionCapacity(value)
end

#two_dimension_capacity=(value) ⇒ Object

Sets the second dimension to the specified value. If value is nil, then the dimension is set to default one.



13
14
15
16
17
# File 'lib/catissue/domain/capacity.rb', line 13

def two_dimension_capacity=(value)
   # update the bounds as well
  bounds.y = value ||= 1
  setTwoDimensionCapacity(value)
end