Class: Io::Flow::V0::Models::FlowBehavior

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

Returns a new instance of FlowBehavior.



20548
20549
20550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20548

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20546
20547
20548
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20546

def value
  @value
end

Class Method Details

.ALLObject



20568
20569
20570
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20568

def FlowBehavior.ALL
  @@all ||= [FlowBehavior.view_consumer_data]
end

.apply(value) ⇒ Object

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



20553
20554
20555
20556
20557
20558
20559
20560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20553

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

.from_string(value) ⇒ Object

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



20563
20564
20565
20566
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20563

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

.view_consumer_dataObject

Allows user to view consumers’ personal data.



20573
20574
20575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20573

def FlowBehavior.view_consumer_data
  @@_view_consumer_data ||= FlowBehavior.new('view_consumer_data')
end

Instance Method Details

#to_hashObject



20577
20578
20579
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20577

def to_hash
  value
end