Class: UspsApi::LabelType11

Inherits:
Object
  • Object
show all
Defined in:
lib/usps_api/models/label_type11.rb

Overview

The requested image size. - Using ‘6X4LABEL` will return the image in the `indiciaImage` response field. - Using `IMI_DATA_ONLY` will return the IMI data in the `indiciaIMI` response field and not populate the `indiciaImage` or `receiptImage` field.

Constant Summary collapse

LABEL_TYPE11 =
[
  # TODO: Write general description for ENUM_6X4LABEL
  ENUM_6X4LABEL = '6X4LABEL'.freeze,

  # TODO: Write general description for IMI_DATA_ONLY
  IMI_DATA_ONLY = 'IMI_DATA_ONLY'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_6X4LABEL) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/usps_api/models/label_type11.rb', line 26

def self.from_value(value, default_value = ENUM_6X4LABEL)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'enum_6x4label' then ENUM_6X4LABEL
  when 'imi_data_only' then IMI_DATA_ONLY
  else
    default_value
  end
end

.validate(value) ⇒ Object



20
21
22
23
24
# File 'lib/usps_api/models/label_type11.rb', line 20

def self.validate(value)
  return false if value.nil?

  LABEL_TYPE11.include?(value)
end