class Io::Flow::V0::Models::PostalType

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25084
def PostalType.ALL
  @@all ||= [PostalType.eircode, PostalType.pin, PostalType.postal, PostalType.zip]
end
apply(value) click to toggle source

Returns the instance of PostalType for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 25069
def PostalType.apply(value)
  if value.instance_of?(PostalType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PostalType.new(value))
  end
end
eircode() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25088
def PostalType.eircode
  @@_eircode ||= PostalType.new('eircode')
end
from_string(value) click to toggle source

Returns the instance of PostalType for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 25079
def PostalType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PostalType.ALL.find { |v| v.value == value }
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25064
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
pin() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25092
def PostalType.pin
  @@_pin ||= PostalType.new('pin')
end
postal() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25096
def PostalType.postal
  @@_postal ||= PostalType.new('postal')
end
zip() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25100
def PostalType.zip
  @@_zip ||= PostalType.new('zip')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 25104
def to_hash
  value
end