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/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, InvalidDateRange, Key, Member, MissingConfig, NoClassGiven, ParamMissing, QueryBuilder, QueryParamMissing, RestClient, RpcClient, Service, UnknownFormat
Constant Summary
collapse
- @@config =
nil
Class Method Summary
collapse
Class Method Details
.activity(activity_type, service_id, options) ⇒ Object
48
49
50
|
# File 'lib/mashery.rb', line 48
def self.activity(activity_type, service_id, options)
Mashery.rest.activity(activity_type, service_id, options)
end
|
.config ⇒ Object
27
28
29
30
|
# File 'lib/mashery.rb', line 27
def self.config
raise Mashery::ConfigMissing.new unless @@config.present?
@@config
end
|
.config=(other) ⇒ Object
32
33
34
|
# File 'lib/mashery.rb', line 32
def self.config=(other)
@@config = other
end
|
.load_config!(yaml_file) ⇒ Object
36
37
38
|
# File 'lib/mashery.rb', line 36
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_config ⇒ Object
10
11
12
|
# File 'lib/mashery/rails.rb', line 10
def self.rails_config
Rails.root.join("config", "mashery.yml")
end
|
.rest ⇒ Object
44
45
46
|
# File 'lib/mashery.rb', line 44
def self.rest
Mashery::RestClient.new
end
|
.rpc ⇒ Object
40
41
42
|
# File 'lib/mashery.rb', line 40
def self.rpc
Mashery::RpcClient.new
end
|