First time here? Check out the Help page!
1 | initial version |
puts plenumSurface.adjacentSurface.get.to_s # DOES NOT WORK!
will return a string of the whole OS:Surface object. To get the name
of the adjacent surface:
puts plenumSurface.adjacentSurface.get.name.to_s
As for
puts plenumSurface.adjacentSurface.handle # DOES NOT WORK!
you need to .get
the adjacentSurface, otherwise you're asking for the handle
of an OS:OptionalSurface, which is an undefined method for that class. Instead:
puts plenumSurface.adjacentSurface.get.handle
will return the adjacent surface's handle.
2 | No.2 Revision |
will return a string of the whole OS:Surface object. To get the name
of the adjacent surface:
puts plenumSurface.adjacentSurface.get.name.to_s
As for
puts plenumSurface.adjacentSurface.handle # DOES NOT WORK!
you need to .get
the adjacentSurface, otherwise you're asking for the handle
of an OS:OptionalSurface, which is an undefined method for that class. Instead:
puts plenumSurface.adjacentSurface.get.handle
will return the adjacent surface's handle.
Note that all of the above will only work if the plenumSurface always has an adjacent surface defined, which might not always be the case. For more about making sure optional types exist before 'getting' them, see the bit about boost::optional
in the measure writing guide.
3 | No.3 Revision |
puts plenumSurface.adjacentSurface.get.to_s # DOES NOT WORK!
will return a string of the whole OS:Surface object. To get the name
of the adjacent surface:
puts plenumSurface.adjacentSurface.get.name.to_s
As for
puts plenumSurface.adjacentSurface.handle # DOES NOT WORK!
you need to .get
the adjacentSurface, otherwise you're asking for the handle
of an OS:OptionalSurface, which is an undefined method for that class. Instead:
puts plenumSurface.adjacentSurface.get.handle
will return the adjacent surface's handle.
Note that all of the above will only work if the plenumSurface always has an adjacent surface defined, which might not always be the case. For more about making sure optional types exist before 'getting' them, see the bit about boost::optional
in the measure writing guide.