Class: Io::Flow::V0::Models::AttributeIntent

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) ⇒ AttributeIntent

Returns a new instance of AttributeIntent.



7348
7349
7350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7348

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7346
7347
7348
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7346

def value
  @value
end

Class Method Details

.ALLObject



7368
7369
7370
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7368

def AttributeIntent.ALL
  @@all ||= [AttributeIntent.brand, AttributeIntent.fulfillment_method, AttributeIntent.hazardous, AttributeIntent.price, AttributeIntent.taxability]
end

.apply(value) ⇒ Object

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



7353
7354
7355
7356
7357
7358
7359
7360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7353

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

.brandObject

Attributes with this data type imply that this is the brand name of the item for retailers that sell multiple brands



7374
7375
7376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7374

def AttributeIntent.brand
  @@_brand ||= AttributeIntent.new('brand')
end

.from_string(value) ⇒ Object

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



7363
7364
7365
7366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7363

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

.fulfillment_methodObject

Attributes with this data type imply whether delivery is a package or digital good.



7380
7381
7382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7380

def AttributeIntent.fulfillment_method
  @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method')
end

.hazardousObject

Attributes with this data type imply whether this item may contain hazardous materials.



7386
7387
7388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7386

def AttributeIntent.hazardous
  @@_hazardous ||= AttributeIntent.new('hazardous')
end

.priceObject

Attributes with this data type are inferred to be prices in the organization’s base currency and will be localized based on each Experience’s pricing policy.



7392
7393
7394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7392

def AttributeIntent.price
  @@_price ||= AttributeIntent.new('price')
end

.taxabilityObject

Attributes with this data type imply whether taxes are applicable to an item.



7397
7398
7399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7397

def AttributeIntent.taxability
  @@_taxability ||= AttributeIntent.new('taxability')
end

Instance Method Details

#to_hashObject



7401
7402
7403
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7401

def to_hash
  value
end