Module: Zebra::Epl::Font

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

Defined Under Namespace

Classes: InvalidFontError

Constant Summary collapse

SIZE_1 =
1
SIZE_2 =
2
SIZE_3 =
3
SIZE_4 =
4
SIZE_5 =
5

Class Method Summary collapse

Class Method Details

.valid_font?(font) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/zebra/epl/font.rb', line 12

def self.valid_font?(font)
  (1..5).include?(font.to_i) || ('A'..'Z').include?(font)
end

.validate_font(font) ⇒ Object

Raises:



16
17
18
# File 'lib/zebra/epl/font.rb', line 16

def self.validate_font(font)
  raise InvalidFontError unless valid_font?(font)
end