Class: Mush::Service
Overview
This is the class all the services must inherit from.
Direct Known Subclasses
AuthenticatedService, Mush::Services::Custom, Mush::Services::IsGd
Instance Method Summary collapse
- #authorize(args = {}) ⇒ Object
-
#get(path, options = {}) ⇒ Object
wrapper for HTTParty.get.
- #shorten ⇒ Object
Instance Method Details
#authorize(args = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/mush/service.rb', line 16 def (args = {}) raise InvalidAuthorizationData.new("Invalid Authorization Data, please provide both login and apikey") unless args @login = [:login] @apikey = [:apikey] end |
#get(path, options = {}) ⇒ Object
wrapper for HTTParty.get
8 9 10 |
# File 'lib/mush/service.rb', line 8 def get(path, = {}) self.class.get(path, ) end |
#shorten ⇒ Object
12 13 14 |
# File 'lib/mush/service.rb', line 12 def shorten(*) raise InterfaceMethodNotImplementedError.new("Service#shorten must be overridden in subclasses") end |