Sha256: 3794d52ed55fee8313dd53e8705eb592db9b1b58d3d86a4a42c34782c965e711

Contents?: true

Size: 624 Bytes

Versions: 27

Compression:

Stored size: 624 Bytes

Contents

module MasterView
  module Directives
    #outputs an else/end block around the text tags removing previous end tag (from if/elsif)
    class Else < MasterView::DirectiveBase
      def priority
        DirectivePriorities::High
      end

      def stag(directive_call_stack)
        tag = @directive_call_stack.context[:tag]
        delete_last_in_parent(tag, erb('end') )
        ret = []
        ret << erb('else')
        ret << directive_call_stack.render
      end

      def etag(directive_call_stack)
        ret = []
        ret << directive_call_stack.render
        ret << erb('end')
      end

    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
masterview-0.2.2 lib/masterview/directives/else.rb
masterview-0.2.3 lib/masterview/directives/else.rb
masterview-0.2.4 lib/masterview/directives/else.rb
masterview_parser-0.0.6 lib/masterview/directives/else.rb
masterview_parser-0.0.5 lib/masterview/directives/else.rb
masterview_parser-0.0.4 lib/masterview/directives/else.rb
masterview_parser-0.0.3 lib/masterview/directives/else.rb