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.



12137
12138
12139
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12137

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12135
12136
12137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12135

def value
  @value
end

Class Method Details

.ALLObject



12157
12158
12159
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12157

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



12142
12143
12144
12145
12146
12147
12148
12149
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12142

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



12177
12178
12179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12177

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

.companyObject



12197
12198
12199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12197

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

.countryObject



12189
12190
12191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12189

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

.first_nameObject



12161
12162
12163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12161

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



12152
12153
12154
12155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12152

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

.last_nameObject



12165
12166
12167
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12165

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

.phoneObject



12193
12194
12195
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12193

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

.postalObject



12185
12186
12187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12185

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

.provinceObject



12181
12182
12183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12181

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

.street_1Object



12169
12170
12171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12169

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

.street_2Object



12173
12174
12175
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12173

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

Instance Method Details

#to_hashObject



12201
12202
12203
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12201

def to_hash
  value
end