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.



15110
15111
15112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15110

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15108
15109
15110
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15108

def value
  @value
end

Class Method Details

.ALLObject



15130
15131
15132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15130

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



15115
15116
15117
15118
15119
15120
15121
15122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15115

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



15125
15126
15127
15128
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15125

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.



15135
15136
15137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15135

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

Instance Method Details

#to_hashObject



15139
15140
15141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15139

def to_hash
  value
end