class Io::Flow::V0::Models::AttributeDataType

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 16639
def AttributeDataType.ALL
  @@all ||= [AttributeDataType.boolean, AttributeDataType.integer, AttributeDataType.decimal, AttributeDataType.string, AttributeDataType.json_array]
end
apply(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 16624
def AttributeDataType.apply(value)
  if value.instance_of?(AttributeDataType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || AttributeDataType.new(value))
  end
end
boolean() click to toggle source

Boolean true/false data type

# File lib/flow_commerce/flow_api_v0_client.rb, line 16644
def AttributeDataType.boolean
  @@_boolean ||= AttributeDataType.new('boolean')
end
decimal() click to toggle source

Decimal datatype without size or precision restrictions. Commonly used for currency values.

# File lib/flow_commerce/flow_api_v0_client.rb, line 16655
def AttributeDataType.decimal
  @@_decimal ||= AttributeDataType.new('decimal')
end
from_string(value) click to toggle source

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

# File lib/flow_commerce/flow_api_v0_client.rb, line 16634
def AttributeDataType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  AttributeDataType.ALL.find { |v| v.value == value }
end
integer() click to toggle source

Value of the attribute must be an integer

# File lib/flow_commerce/flow_api_v0_client.rb, line 16649
def AttributeDataType.integer
  @@_integer ||= AttributeDataType.new('integer')
end
json_array() click to toggle source

An example [“Cotton”, “Wool”]

# File lib/flow_commerce/flow_api_v0_client.rb, line 16665
def AttributeDataType.json_array
  @@_json_array ||= AttributeDataType.new('json_array')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 16619
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
string() click to toggle source

Unvalidated string of characters.

# File lib/flow_commerce/flow_api_v0_client.rb, line 16660
def AttributeDataType.string
  @@_string ||= AttributeDataType.new('string')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 16669
def to_hash
  value
end