Class: Io::Flow::V0::Models::AuthenticationTechnique
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AuthenticationTechnique
- 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
-
.anonymous ⇒ Object
No authentication necessary.
-
.apply(value) ⇒ Object
Returns the instance of AuthenticationTechnique for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of AuthenticationTechnique for this value, or nil if not found.
-
.session ⇒ Object
A browser has been assigned an identifier by flow to track their use of our service for an organization.
-
.token ⇒ Object
A token.
-
.user ⇒ Object
A user logs into Flow.
Instance Method Summary collapse
-
#initialize(value) ⇒ AuthenticationTechnique
constructor
A new instance of AuthenticationTechnique.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AuthenticationTechnique
Returns a new instance of AuthenticationTechnique.
10206 10207 10208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10206 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10204 10205 10206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10204 def value @value end |
Class Method Details
.ALL ⇒ Object
10226 10227 10228 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10226 def AuthenticationTechnique.ALL @@all ||= [AuthenticationTechnique.anonymous, AuthenticationTechnique.session, AuthenticationTechnique.token, AuthenticationTechnique.user] end |
.anonymous ⇒ Object
No authentication necessary.
10231 10232 10233 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10231 def AuthenticationTechnique.anonymous @@_anonymous ||= AuthenticationTechnique.new('anonymous') end |
.apply(value) ⇒ Object
Returns the instance of AuthenticationTechnique for this value, creating a new instance for an unknown value
10211 10212 10213 10214 10215 10216 10217 10218 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10211 def AuthenticationTechnique.apply(value) if value.instance_of?(AuthenticationTechnique) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || AuthenticationTechnique.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of AuthenticationTechnique for this value, or nil if not found
10221 10222 10223 10224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10221 def AuthenticationTechnique.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AuthenticationTechnique.ALL.find { |v| v.value == value } end |
.session ⇒ Object
A browser has been assigned an identifier by flow to track their use of our service for an organization.
10237 10238 10239 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10237 def AuthenticationTechnique.session @@_session ||= AuthenticationTechnique.new('session') end |
.token ⇒ Object
A token. Tokens carry the same permissions as the user who originally created them.
10243 10244 10245 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10243 def AuthenticationTechnique.token @@_token ||= AuthenticationTechnique.new('token') end |
.user ⇒ Object
A user logs into Flow.
10248 10249 10250 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10248 def AuthenticationTechnique.user @@_user ||= AuthenticationTechnique.new('user') end |
Instance Method Details
#to_hash ⇒ Object
10252 10253 10254 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10252 def to_hash value end |