Class: UspsApi::ReceiptOption
- Inherits:
-
Object
- Object
- UspsApi::ReceiptOption
- Defined in:
- lib/usps_api/models/receipt_option.rb
Overview
Indicia & Receipt print out options: Enter ‘SEPARATE_PAGE` to print the Indicia and the Receipt on separate pages. Enter `NONE` to print the Indicia only and no Receipt.
Constant Summary collapse
- RECEIPT_OPTION =
[ # TODO: Write general description for SEPARATE_PAGE SEPARATE_PAGE = 'SEPARATE_PAGE'.freeze, # TODO: Write general description for NONE NONE = 'NONE'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = SEPARATE_PAGE) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/usps_api/models/receipt_option.rb', line 25 def self.from_value(value, default_value = SEPARATE_PAGE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'separate_page' then SEPARATE_PAGE when 'none' then NONE else default_value end end |
.validate(value) ⇒ Object
19 20 21 22 23 |
# File 'lib/usps_api/models/receipt_option.rb', line 19 def self.validate(value) return false if value.nil? RECEIPT_OPTION.include?(value) end |