Class: CaTissue::Capacity

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

Instance Method Summary collapse

Methods included from Resource

#database, included, #tolerant_match?

Methods included from Annotatable

#annotation_proxy, #create_proxy, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CaTissue::Annotatable

Instance Method Details

#boundsObject

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



30
31
32
# File 'lib/catissue/domain/capacity.rb', line 30

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.



10
11
12
13
14
# File 'lib/catissue/domain/capacity.rb', line 10

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.



17
18
19
20
21
# File 'lib/catissue/domain/capacity.rb', line 17

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