Class: Mush::Service

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mush/service.rb

Overview

This is the class all the services must inherit from.

Instance Method Summary collapse

Instance Method Details

#authorize(args = {}) ⇒ Object



16
17
18
19
20
# File 'lib/mush/service.rb', line 16

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

#get(path, options = {}) ⇒ Object

wrapper for HTTParty.get



8
9
10
# File 'lib/mush/service.rb', line 8

def get(path, options = {})
  self.class.get(path, options)
end

#shortenObject



12
13
14
# File 'lib/mush/service.rb', line 12

def shorten(*)
  raise InterfaceMethodNotImplementedError.new("Service#shorten must be overridden in subclasses")
end