Skip to content

Commit

Permalink
Mixins included into inheritance chain
Browse files Browse the repository at this point in the history
  • Loading branch information
inossidabile committed Nov 10, 2013
1 parent 3ded1a8 commit 2703b80
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/entities/class.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ module.exports = class Entities.Class extends require('../entity')

@_effectiveMethods

allMethods: ->
methods = @effectiveMethods()
methods = methods.concat mixin.effectiveInclusionMethods() for mixin in @includes
methods = methods.concat mixin.effectiveExtensionMethods() for mixin in @extends
methods = methods.concat mixin.effectiveConcernMethods() for mixin in @concerns

methods

inherited: (getter) ->
return [] if !@parent || !@parent.name?

Expand All @@ -173,7 +181,7 @@ module.exports = class Entities.Class extends require('../entity')

inheritedMethods: ->
@_inheritedMethods ||= @inherited =>
@parent.effectiveMethods().concat(@parent.inheritedMethods())
@parent.allMethods().concat(@parent.inheritedMethods())

inheritedVariables: ->
@_inheritedVariables ||= @inherited =>
Expand Down

0 comments on commit 2703b80

Please sign in to comment.