Class: Io::Flow::V0::HttpClient::Authorization
- Inherits:
-
Object
- Object
- Io::Flow::V0::HttpClient::Authorization
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(scheme, username, opts = {}) ⇒ Authorization
constructor
A new instance of Authorization.
Constructor Details
#initialize(scheme, username, opts = {}) ⇒ Authorization
Returns a new instance of Authorization.
29693 29694 29695 29696 29697 29698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29693 def initialize(scheme, username, opts={}) @scheme = HttpClient::Preconditions.assert_class('schema', scheme, AuthScheme) @username = HttpClient::Preconditions.check_not_blank('username', username, "username is required") @password = HttpClient::Preconditions.assert_class_or_nil('password', opts.delete(:password), String) HttpClient::Preconditions.assert_empty_opts(opts) end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
29691 29692 29693 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29691 def password @password end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
29691 29692 29693 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29691 def scheme @scheme end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
29691 29692 29693 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29691 def username @username end |
Class Method Details
.basic(username, password = nil) ⇒ Object
29700 29701 29702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29700 def Authorization.basic(username, password=nil) Authorization.new(AuthScheme::BASIC, username, :password => password) end |