Class: CanTango::Configuration::Permits
Instance Attribute Summary collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
17
18
19
|
# File 'lib/cantango/configuration/permits.rb', line 17
def method_missing method_name, *args
accounts[method_name] ||= PermitRegistry.new
end
|
Instance Attribute Details
#accounts ⇒ Object
9
10
11
|
# File 'lib/cantango/configuration/permits.rb', line 9
def accounts
@accounts
end
|
Instance Method Details
#account_hash(name) ⇒ Object
13
14
15
|
# File 'lib/cantango/configuration/permits.rb', line 13
def account_hash name
accounts[name]
end
|
#register_permit_class(permit_name, permit_clazz, permit_type, account_name) ⇒ Object
21
22
23
24
|
# File 'lib/cantango/configuration/permits.rb', line 21
def register_permit_class(permit_name, permit_clazz, permit_type, account_name)
registry = account_name ? self.send(account_name.to_sym) : self
registry.send(permit_type)[permit_name] = permit_clazz
end
|