Class: Io::Flow::V0::Models::AddressFieldName

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ AddressFieldName

Returns a new instance of AddressFieldName.



12848
12849
12850
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12848

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12846
12847
12848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12846

def value
  @value
end

Class Method Details

.ALLObject



12868
12869
12870
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12868

def AddressFieldName.ALL
  @@all ||= [AddressFieldName.first_name, AddressFieldName.last_name, AddressFieldName.street_1, AddressFieldName.street_2, AddressFieldName.city, AddressFieldName.province, AddressFieldName.postal, AddressFieldName.country, AddressFieldName.phone, AddressFieldName.company, AddressFieldName.vat_registration_number]
end

.apply(value) ⇒ Object

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



12853
12854
12855
12856
12857
12858
12859
12860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12853

def AddressFieldName.apply(value)
  if value.instance_of?(AddressFieldName)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || AddressFieldName.new(value))
  end
end

.cityObject



12888
12889
12890
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12888

def AddressFieldName.city
  @@_city ||= AddressFieldName.new('city')
end

.companyObject



12908
12909
12910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12908

def AddressFieldName.company
  @@_company ||= AddressFieldName.new('company')
end

.countryObject



12900
12901
12902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12900

def AddressFieldName.country
  @@_country ||= AddressFieldName.new('country')
end

.first_nameObject



12872
12873
12874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12872

def AddressFieldName.first_name
  @@_first_name ||= AddressFieldName.new('first_name')
end

.from_string(value) ⇒ Object

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



12863
12864
12865
12866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12863

def AddressFieldName.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  AddressFieldName.ALL.find { |v| v.value == value }
end

.last_nameObject



12876
12877
12878
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12876

def AddressFieldName.last_name
  @@_last_name ||= AddressFieldName.new('last_name')
end

.phoneObject



12904
12905
12906
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12904

def AddressFieldName.phone
  @@_phone ||= AddressFieldName.new('phone')
end

.postalObject



12896
12897
12898
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12896

def AddressFieldName.postal
  @@_postal ||= AddressFieldName.new('postal')
end

.provinceObject



12892
12893
12894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12892

def AddressFieldName.province
  @@_province ||= AddressFieldName.new('province')
end

.street_1Object



12880
12881
12882
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12880

def AddressFieldName.street_1
  @@_street_1 ||= AddressFieldName.new('street_1')
end

.street_2Object



12884
12885
12886
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884

def AddressFieldName.street_2
  @@_street_2 ||= AddressFieldName.new('street_2')
end

.vat_registration_numberObject



12912
12913
12914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12912

def AddressFieldName.vat_registration_number
  @@_vat_registration_number ||= AddressFieldName.new('vat_registration_number')
end

Instance Method Details

#to_hashObject



12916
12917
12918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12916

def to_hash
  value
end