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.



6884
6885
6886
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6884

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6882
6883
6884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6882

def value
  @value
end

Class Method Details

.ALLObject



6904
6905
6906
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6904

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

.apply(value) ⇒ Object

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



6889
6890
6891
6892
6893
6894
6895
6896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6889

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

.from_string(value) ⇒ Object

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



6899
6900
6901
6902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6899

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.



6910
6911
6912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6910

def AttributeIntent.fulfillment_method
  @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method')
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.



6916
6917
6918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6916

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

.taxabilityObject

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



6921
6922
6923
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6921

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

Instance Method Details

#to_hashObject



6925
6926
6927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6925

def to_hash
  value
end