Class: Io::Flow::V0::Models::SyncStreamType

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

Returns a new instance of SyncStreamType.



21047
21048
21049
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21047

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21045
21046
21047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21045

def value
  @value
end

Class Method Details

.ALLObject



21067
21068
21069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21067

def SyncStreamType.ALL
  @@all ||= [SyncStreamType., SyncStreamType.placed_order]
end

.apply(value) ⇒ Object

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



21052
21053
21054
21055
21056
21057
21058
21059
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21052

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

.from_string(value) ⇒ Object

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



21062
21063
21064
21065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21062

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

.placed_orderObject

Represents a sync stream of placed orders - ie each record reported represents a placed order



21079
21080
21081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21079

def SyncStreamType.placed_order
  @@_placed_order ||= SyncStreamType.new('placed_order')
end

.submitted_orderObject

Represents a sync stream of submitted orders - ie each record reported represents a submitted order



21073
21074
21075
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21073

def SyncStreamType.
   ||= SyncStreamType.new('submitted_order')
end

Instance Method Details

#to_hashObject



21083
21084
21085
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21083

def to_hash
  value
end