Class: Io::Flow::V0::Models::FlowBehavior
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FlowBehavior
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of FlowBehavior for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of FlowBehavior for this value, or nil if not found.
-
.view_consumer_data ⇒ Object
Allows user to view consumers’ personal data.
Instance Method Summary collapse
-
#initialize(value) ⇒ FlowBehavior
constructor
A new instance of FlowBehavior.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ FlowBehavior
Returns a new instance of FlowBehavior.
16280 16281 16282 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16280 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16278 16279 16280 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16278 def value @value end |
Class Method Details
.ALL ⇒ Object
16300 16301 16302 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16300 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
16285 16286 16287 16288 16289 16290 16291 16292 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16285 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
16295 16296 16297 16298 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16295 def FlowBehavior.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) FlowBehavior.ALL.find { |v| v.value == value } end |
.view_consumer_data ⇒ Object
Allows user to view consumers’ personal data.
16305 16306 16307 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16305 def FlowBehavior.view_consumer_data @@_view_consumer_data ||= FlowBehavior.new('view_consumer_data') end |
Instance Method Details
#to_hash ⇒ Object
16309 16310 16311 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16309 def to_hash value end |