Skip to content

Commit

Permalink
add method partial to tags
Browse files Browse the repository at this point in the history
  • Loading branch information
dodo committed May 27, 2014
1 parent e7b1272 commit 65d6fe0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cache.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ create = (key, opts) ->
Tag = xml.Tag
# create new tag class to extend it with a schema
class ExtendedTag extends Tag
partial: (partial) ->
return this unless partial.run? # tag should be already added then
@add(partial)
partial.run() # guess this is a template
return this
# create tag method shortcuts defined by schema
ff ExtendedTag::, opts.schema
# write it back so builder can use it to instantiate a new tag
Expand Down

0 comments on commit 65d6fe0

Please sign in to comment.