Module: Mashery

Defined in:
lib/mashery.rb,
lib/mashery/key.rb,
lib/mashery/rails.rb,
lib/mashery/config.rb,
lib/mashery/member.rb,
lib/mashery/service.rb,
lib/mashery/version.rb,
lib/mashery/generator.rb,
lib/mashery/exceptions.rb,
lib/mashery/rpc_client.rb,
lib/mashery/rest_client.rb,
lib/mashery/query_builder.rb,
lib/mashery/rpc_client/base.rb,
lib/mashery/rest_client/query.rb,
lib/mashery/rpc_client/response.rb

Defined Under Namespace

Classes: Config, ConfigMissing, Engine, InstallGenerator, InvalidDateRange, Key, Member, MissingConfig, NoClassGiven, ParamMissing, QueryBuilder, QueryParamMissing, RestClient, RpcClient, Service, UnknownFormat

Constant Summary collapse

VERSION =
"0.6.3"
@@config =
nil

Class Method Summary collapse

Class Method Details

.activity(activity_type, service_id, options) ⇒ Object



50
51
52
# File 'lib/mashery.rb', line 50

def self.activity(activity_type, service_id, options)
  Mashery.rest.activity(activity_type, service_id, options)
end

.configObject



29
30
31
32
# File 'lib/mashery.rb', line 29

def self.config
  raise Mashery::ConfigMissing.new unless @@config.present?
  @@config
end

.config=(other) ⇒ Object



34
35
36
# File 'lib/mashery.rb', line 34

def self.config=(other)
  @@config = other
end

.load_config!(yaml_file) ⇒ Object



38
39
40
# File 'lib/mashery.rb', line 38

def self.load_config!(yaml_file)
  Mashery.config = Mashery::Config.new(yaml_file)
end

.load_rails_config!Object



2
3
4
5
6
7
8
# File 'lib/mashery/rails.rb', line 2

def self.load_rails_config!
  if File.exists? rails_config
    load_config! rails_config
  else
    # raise MissingConfig.new
  end
end

.rails_configObject



10
11
12
# File 'lib/mashery/rails.rb', line 10

def self.rails_config
  Rails.root.join("config", "mashery.yml")
end

.restObject



46
47
48
# File 'lib/mashery.rb', line 46

def self.rest
  Mashery::RestClient.new
end

.rpcObject



42
43
44
# File 'lib/mashery.rb', line 42

def self.rpc
  Mashery::RpcClient.new
end