Module: Zebra::Epl::Rotation

Defined in:
lib/zebra/epl/rotation.rb

Defined Under Namespace

Classes: InvalidRotationError

Constant Summary collapse

NO_ROTATION =
0
DEGREES_90 =
1
DEGREES_180 =
2
DEGREES_270 =
3

Class Method Summary collapse

Class Method Details

.valid_rotation?(rotation) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/zebra/epl/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/epl/rotation.rb', line 15

def self.validate_rotation(rotation)
  raise InvalidRotationError unless valid_rotation?(rotation)
end