Module: Trole::Api::ClassMethods
- Included in:
- Trole::Api
- Defined in:
- lib/trole/api.rb
Overview
When the Trole::Api is included by the Role Subject class (fx a User Account) first include methods from Troles Common API
then include Trole API on top
Instance Method Summary collapse
Instance Method Details
#included(base) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/trole/api.rb', line 25 def included(base) base.send :include, Troles::Common::Api self.extend Troles::Common::Api::ClassMethods # draws in the #apis method from Common Api apis.each do |api| begin base.send :include, "Trole::Api::#{api.to_s.camelize}".constantize base.extend "Trole::Api::#{api.to_s.camelize}::ClassMethods".constantize # base.include_and_extend :"#{api.to_s.camelize}" rescue end end end |