Module: Zebra::Zpl::Rotation
- Defined in:
- lib/zebra/zpl/rotation.rb
Defined Under Namespace
Classes: InvalidRotationError
Constant Summary
collapse
- NO_ROTATION =
'N'
- DEGREES_90 =
'R'
- DEGREES_180 =
'I'
- DEGREES_270 =
'B'
Class Method Summary
collapse
Class Method Details
.valid_rotation?(rotation) ⇒ Boolean
11
12
13
|
# File 'lib/zebra/zpl/rotation.rb', line 11
def self.valid_rotation?(rotation)
[NO_ROTATION, DEGREES_90, DEGREES_180, DEGREES_270].include? rotation
end
|
.validate_rotation(rotation) ⇒ Object
15
16
17
|
# File 'lib/zebra/zpl/rotation.rb', line 15
def self.validate_rotation(rotation)
raise InvalidRotationError unless valid_rotation?(rotation)
end
|