Module: Troles::Api::ClassMethods
- Included in:
- Troles::Api
- Defined in:
- lib/troles/api.rb
Instance Method Summary collapse
-
#included(base) ⇒ Object
When the Troles::Api is included by the Role Subject class (fx a User Account) first include methods from Troles Common API then include Troles API on top.
Instance Method Details
#included(base) ⇒ Object
When the Troles::Api is included by the Role Subject class (fx a User Account) first include methods from Troles Common API
then include Troles API on top
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/troles/api.rb', line 26 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, "Troles::Api::#{api.to_s.camelize}".constantize base.extend "Troles::Api::#{api.to_s.camelize}::ClassMethods".constantize rescue end end end |