Class: UspsApi::ShippingFilter1

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

Overview

A filter for international results to return only one response based on lowest price. There are no service standards for international.

Constant Summary collapse

SHIPPING_FILTER1 =
[
  # TODO: Write general description for PRICE
  PRICE = 'PRICE'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = PRICE) ⇒ Object



21
22
23
24
25
# File 'lib/usps_api/models/shipping_filter1.rb', line 21

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

  default_value
end

.validate(value) ⇒ Object



15
16
17
18
19
# File 'lib/usps_api/models/shipping_filter1.rb', line 15

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

  SHIPPING_FILTER1.include?(value)
end