Class: SwaggerPetstore::HttpBasicCredentials
- Inherits:
-
Object
- Object
- SwaggerPetstore::HttpBasicCredentials
- Defined in:
- lib/swagger_petstore/http/auth/http_basic.rb
Overview
Data class for HttpBasicCredentials.
Instance Attribute Summary collapse
-
#passwprd ⇒ Object
readonly
Returns the value of attribute passwprd.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #clone_with(username: nil, passwprd: nil) ⇒ Object
-
#initialize(username:, passwprd:) ⇒ HttpBasicCredentials
constructor
A new instance of HttpBasicCredentials.
Constructor Details
#initialize(username:, passwprd:) ⇒ HttpBasicCredentials
Returns a new instance of HttpBasicCredentials.
35 36 37 38 39 40 41 |
# File 'lib/swagger_petstore/http/auth/http_basic.rb', line 35 def initialize(username:, passwprd:) raise ArgumentError, 'username cannot be nil' if username.nil? raise ArgumentError, 'passwprd cannot be nil' if passwprd.nil? @username = username @passwprd = passwprd end |
Instance Attribute Details
#passwprd ⇒ Object (readonly)
Returns the value of attribute passwprd.
33 34 35 |
# File 'lib/swagger_petstore/http/auth/http_basic.rb', line 33 def passwprd @passwprd end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
33 34 35 |
# File 'lib/swagger_petstore/http/auth/http_basic.rb', line 33 def username @username end |
Instance Method Details
#clone_with(username: nil, passwprd: nil) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/swagger_petstore/http/auth/http_basic.rb', line 43 def clone_with(username: nil, passwprd: nil) username ||= self.username passwprd ||= self.passwprd HttpBasicCredentials.new(username: username, passwprd: passwprd) end |