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.



14417
14418
14419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14417

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14415
14416
14417
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14415

def value
  @value
end

Class Method Details

.ALLObject



14437
14438
14439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14437

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



14422
14423
14424
14425
14426
14427
14428
14429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14422

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



14432
14433
14434
14435
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14432

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.



14442
14443
14444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14442

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

Instance Method Details

#to_hashObject



14446
14447
14448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14446

def to_hash
  value
end