Class: Io::Flow::V0::Models::ReturnStatus

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



12596
12597
12598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12596

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12594
12595
12596
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12594

def value
  @value
end

Class Method Details

.ALLObject



12616
12617
12618
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12616

def ReturnStatus.ALL
  @@all ||= [ReturnStatus.open, ReturnStatus.refunded]
end

.apply(value) ⇒ Object

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



12601
12602
12603
12604
12605
12606
12607
12608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12601

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

.from_string(value) ⇒ Object

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



12611
12612
12613
12614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12611

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

.openObject



12620
12621
12622
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12620

def ReturnStatus.open
  @@_open ||= ReturnStatus.new('open')
end

.refundedObject



12624
12625
12626
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12624

def ReturnStatus.refunded
  @@_refunded ||= ReturnStatus.new('refunded')
end

Instance Method Details

#to_hashObject



12628
12629
12630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12628

def to_hash
  value
end