Class: Mush::AuthenticatedService
- Defined in:
- lib/mush/authenticated_service.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#apikey ⇒ Object
Returns the value of attribute apikey.
-
#login ⇒ Object
Returns the value of attribute login.
Instance Method Summary collapse
- #authorize(args = {}) ⇒ Object
-
#initialize ⇒ AuthenticatedService
constructor
A new instance of AuthenticatedService.
Methods inherited from Service
Constructor Details
#initialize ⇒ AuthenticatedService
Returns a new instance of AuthenticatedService.
7 8 9 10 |
# File 'lib/mush/authenticated_service.rb', line 7 def initialize @login = '' @apikey = '' end |
Instance Attribute Details
#apikey ⇒ Object
Returns the value of attribute apikey.
5 6 7 |
# File 'lib/mush/authenticated_service.rb', line 5 def apikey @apikey end |
#login ⇒ Object
Returns the value of attribute login.
5 6 7 |
# File 'lib/mush/authenticated_service.rb', line 5 def login @login end |
Instance Method Details
#authorize(args = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/mush/authenticated_service.rb', line 12 def (args = {}) raise InvalidAuthorizationData.new("Invalid Authorization Data, please provide both login and apikey") unless args @login = [:login] @apikey = [:apikey] end |