Class: ESA::ContextProviders::AccountContextProvider
Class Method Summary
collapse
check_subcontexts, contained_subcontexts, existing_subcontexts
Class Method Details
.contained_ids(context, options = {}) ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/esa/context_providers/account_context_provider.rb', line 12
def self.contained_ids(context, options = {})
if options[:all].present? and options[:all] == true
context.accounts.pluck(:id)
else
context.amounts.uniq.pluck(:account_id)
end
end
|
.context_id(context, options = {}) ⇒ Object
8
9
10
|
# File 'lib/esa/context_providers/account_context_provider.rb', line 8
def self.context_id(context, options = {})
context.account_id
end
|
.instantiate(parent, namespace, id, options = {}) ⇒ Object
20
21
22
|
# File 'lib/esa/context_providers/account_context_provider.rb', line 20
def self.instantiate(parent, namespace, id, options = {})
ESA::Contexts::AccountContext.new(chart_id: parent.chart_id, parent_id: parent.id, namespace: namespace, account_id: id)
end
|
.provided_types ⇒ Object
4
5
6
|
# File 'lib/esa/context_providers/account_context_provider.rb', line 4
def self.provided_types
["ESA::Contexts::AccountContext"]
end
|