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.
15267 15268 15269 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15267 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15265 15266 15267 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15265 def value @value end |
Class Method Details
.ALL ⇒ Object
15287 15288 15289 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15287 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
15272 15273 15274 15275 15276 15277 15278 15279 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15272 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
15282 15283 15284 15285 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15282 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.
15292 15293 15294 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15292 def FlowBehavior.view_consumer_data @@_view_consumer_data ||= FlowBehavior.new('view_consumer_data') end |
Instance Method Details
#to_hash ⇒ Object
15296 15297 15298 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15296 def to_hash value end |