class MassdebatorApi::Service

Public Class Methods

base_path() click to toggle source
# File lib/massdebator_api/service.rb, line 5
def self.base_path
  "/api/v1"
end
base_uri() click to toggle source
# File lib/massdebator_api/service.rb, line 9
def self.base_uri
  "http://#{self.host}#{self.base_path}"
end
configuration_hash() click to toggle source
# File lib/massdebator_api/service.rb, line 13
def self.configuration_hash
  if Rails.root
    @@config_hash ||= YAML.load_file("#{Rails.root}/config/massdebator.yml")
  else
    @@config_hash ||= YAML.load_file("config/massdebator.yml")
  end
end
headers() click to toggle source

If headers are not defined in a given subclass, then obtain headers from the superclass.

# File lib/massdebator_api/service.rb, line 45
def headers
  if defined?(@headers)
    @headers
  elsif superclass != Object && superclass.headers
    superclass.headers
  end
end
host() click to toggle source
# File lib/massdebator_api/service.rb, line 21
def self.host
  self.configuration_hash[Rails.env]['host']
end
port() click to toggle source
# File lib/massdebator_api/service.rb, line 33
def self.port
  self.configuration_hash[Rails.env]['port']
end
secret() click to toggle source
# File lib/massdebator_api/service.rb, line 29
def self.secret
  self.configuration_hash[Rails.env]['secret']
end
token() click to toggle source
# File lib/massdebator_api/service.rb, line 25
def self.token
  self.configuration_hash[Rails.env]['token']
end