Class: Mixpannenkoek::Base
Class Method Summary
collapse
class_inheritable_attribute, create_getter, create_setter
Class Method Details
.api_key ⇒ Object
20
21
22
|
# File 'lib/mixpannenkoek/base.rb', line 20
def self.api_key
value_from_block(self._api_key)
end
|
.api_secret ⇒ Object
24
25
26
|
# File 'lib/mixpannenkoek/base.rb', line 24
def self.api_secret
value_from_block(self._api_secret)
end
|
.default_scope(&proc_or_lambda) ⇒ Object
52
53
54
55
|
# File 'lib/mixpannenkoek/base.rb', line 52
def self.default_scope(&proc_or_lambda)
self._default_scope ||= []
self._default_scope += [proc_or_lambda]
end
|
.default_scopes ⇒ Object
57
58
59
60
|
# File 'lib/mixpannenkoek/base.rb', line 57
def self.default_scopes
self._default_scope ||= []
self._default_scope.map{ |p| p.call }
end
|
.endpoint ⇒ Object
28
29
30
|
# File 'lib/mixpannenkoek/base.rb', line 28
def self.endpoint
value_from_block(self._endpoint)
end
|
.set(variable) ⇒ Object
42
43
44
|
# File 'lib/mixpannenkoek/base.rb', line 42
def self.set(variable)
Mixpannenkoek::Query.new(self).set(variable)
end
|
.set_api_key(api_key = nil, &block) ⇒ Object
8
9
10
|
# File 'lib/mixpannenkoek/base.rb', line 8
def self.set_api_key(api_key = nil, &block)
self._api_key = value_or_block(api_key, &block)
end
|
.set_api_secret(api_secret = nil, &block) ⇒ Object
12
13
14
|
# File 'lib/mixpannenkoek/base.rb', line 12
def self.set_api_secret(api_secret = nil, &block)
self._api_secret = value_or_block(api_secret, &block)
end
|
.set_endpoint(endpoint = nil, &block) ⇒ Object
16
17
18
|
# File 'lib/mixpannenkoek/base.rb', line 16
def self.set_endpoint(endpoint = nil, &block)
self._endpoint = value_or_block(endpoint, &block)
end
|
.where(condition) ⇒ Object
Class methods (for convenience)
these methods enable this type of usage: Mixpanel::Query.where(training_name: ‘Training XYZ’).group(‘subject_name’).results
38
39
40
|
# File 'lib/mixpannenkoek/base.rb', line 38
def self.where(condition)
Mixpannenkoek::Query.new(self).where(condition)
end
|