Class: Io::Flow::V0::Models::Visibility
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Visibility
- 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 Visibility for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of Visibility for this value, or nil if not found.
- .private ⇒ Object
- .public ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ Visibility
constructor
A new instance of Visibility.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ Visibility
Returns a new instance of Visibility.
20756 20757 20758 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20756 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20754 20755 20756 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20754 def value @value end |
Class Method Details
.ALL ⇒ Object
20776 20777 20778 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20776 def Visibility.ALL @@all ||= [Visibility.public, Visibility.private] end |
.apply(value) ⇒ Object
Returns the instance of Visibility for this value, creating a new instance for an unknown value
20761 20762 20763 20764 20765 20766 20767 20768 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20761 def Visibility.apply(value) if value.instance_of?(Visibility) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || Visibility.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of Visibility for this value, or nil if not found
20771 20772 20773 20774 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20771 def Visibility.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) Visibility.ALL.find { |v| v.value == value } end |
.private ⇒ Object
20784 20785 20786 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20784 def Visibility.private @@_private ||= Visibility.new('private') end |
.public ⇒ Object
20780 20781 20782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20780 def Visibility.public @@_public ||= Visibility.new('public') end |
Instance Method Details
#to_hash ⇒ Object
20788 20789 20790 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20788 def to_hash value end |