Class: Io::Flow::V0::Models::TradeAgreementStatus

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

Returns a new instance of TradeAgreementStatus.



27938
27939
27940
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27938

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



27936
27937
27938
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27936

def value
  @value
end

Class Method Details

.ALLObject



27958
27959
27960
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27958

def TradeAgreementStatus.ALL
  @@all ||= [TradeAgreementStatus.supported, TradeAgreementStatus.not_supported]
end

.apply(value) ⇒ Object

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



27943
27944
27945
27946
27947
27948
27949
27950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27943

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

.from_string(value) ⇒ Object

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



27953
27954
27955
27956
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27953

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

.not_supportedObject



27966
27967
27968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27966

def TradeAgreementStatus.not_supported
  @@_not_supported ||= TradeAgreementStatus.new('not_supported')
end

.supportedObject



27962
27963
27964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27962

def TradeAgreementStatus.supported
  @@_supported ||= TradeAgreementStatus.new('supported')
end

Instance Method Details

#to_hashObject



27970
27971
27972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27970

def to_hash
  value
end