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.



12746
12747
12748
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12746

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12744
12745
12746
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12744

def value
  @value
end

Class Method Details

.ALLObject



12766
12767
12768
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12766

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]
end

.apply(value) ⇒ Object

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



12751
12752
12753
12754
12755
12756
12757
12758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12751

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



12786
12787
12788
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12786

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

.companyObject



12806
12807
12808
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12806

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

.countryObject



12798
12799
12800
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12798

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

.first_nameObject



12770
12771
12772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12770

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



12761
12762
12763
12764
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12761

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

.last_nameObject



12774
12775
12776
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12774

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

.phoneObject



12802
12803
12804
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12802

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

.postalObject



12794
12795
12796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12794

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

.provinceObject



12790
12791
12792
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12790

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

.street_1Object



12778
12779
12780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12778

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

.street_2Object



12782
12783
12784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12782

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

Instance Method Details

#to_hashObject



12810
12811
12812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12810

def to_hash
  value
end