Class: Mush::AuthenticatedService

Inherits:
Service
  • Object
show all
Defined in:
lib/mush/authenticated_service.rb

Direct Known Subclasses

Services::Bitly

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Service

#get, #shorten

Constructor Details

#initializeAuthenticatedService

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

#apikeyObject

Returns the value of attribute apikey.



5
6
7
# File 'lib/mush/authenticated_service.rb', line 5

def apikey
  @apikey
end

#loginObject

Returns the value of attribute login.



5
6
7
# File 'lib/mush/authenticated_service.rb', line 5

def 
  @login
end

Instance Method Details

#authorize(args = {}) ⇒ Object



12
13
14
15
16
# File 'lib/mush/authenticated_service.rb', line 12

def authorize(args = {})
  raise InvalidAuthorizationData.new("Invalid Authorization Data, please provide both login and apikey") unless valid_authorization_data? args
  @login = options[:login]
  @apikey = options[:apikey]
end