Class: Io::Flow::V0::Models::DutyItemApprovalStatus

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

Returns a new instance of DutyItemApprovalStatus.



19039
19040
19041
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19039

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19037
19038
19039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19037

def value
  @value
end

Class Method Details

.ALLObject



19059
19060
19061
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19059

def DutyItemApprovalStatus.ALL
  @@all ||= [DutyItemApprovalStatus.pending, DutyItemApprovalStatus.certified, DutyItemApprovalStatus.decertified]
end

.apply(value) ⇒ Object

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



19044
19045
19046
19047
19048
19049
19050
19051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19044

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

.certifiedObject



19067
19068
19069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19067

def DutyItemApprovalStatus.certified
  @@_certified ||= DutyItemApprovalStatus.new('certified')
end

.decertifiedObject



19071
19072
19073
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19071

def DutyItemApprovalStatus.decertified
  @@_decertified ||= DutyItemApprovalStatus.new('decertified')
end

.from_string(value) ⇒ Object

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



19054
19055
19056
19057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19054

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

.pendingObject



19063
19064
19065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19063

def DutyItemApprovalStatus.pending
  @@_pending ||= DutyItemApprovalStatus.new('pending')
end

Instance Method Details

#to_hashObject



19075
19076
19077
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19075

def to_hash
  value
end