Class: Io::Flow::V0::Models::ShippingConfigurationType

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

Returns a new instance of ShippingConfigurationType.



26559
26560
26561
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26559

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



26557
26558
26559
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26557

def value
  @value
end

Class Method Details

.ALLObject



26579
26580
26581
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26579

def ShippingConfigurationType.ALL
  @@all ||= [ShippingConfigurationType.default, ShippingConfigurationType.variant]
end

.apply(value) ⇒ Object

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



26564
26565
26566
26567
26568
26569
26570
26571
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26564

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

.defaultObject



26583
26584
26585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26583

def ShippingConfigurationType.default
  @@_default ||= ShippingConfigurationType.new('default')
end

.from_string(value) ⇒ Object

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



26574
26575
26576
26577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26574

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

.variantObject



26587
26588
26589
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26587

def ShippingConfigurationType.variant
  @@_variant ||= ShippingConfigurationType.new('variant')
end

Instance Method Details

#to_hashObject



26591
26592
26593
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26591

def to_hash
  value
end