Sha256: 160ad3656754ac31a2173133f31c12d8d6ef592730a363ed908f0c7ec0250d3b

Contents?: true

Size: 632 Bytes

Versions: 27

Compression:

Stored size: 632 Bytes

Contents

module MasterView
  module Directives

    #outputs an elsif/end block around the text tags and remove previous end (from if)
    class Elsif < 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('elsif '+attr_value)
        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/elsif.rb
masterview-0.2.3 lib/masterview/directives/elsif.rb
masterview-0.2.4 lib/masterview/directives/elsif.rb
masterview_parser-0.0.6 lib/masterview/directives/elsif.rb
masterview_parser-0.0.5 lib/masterview/directives/elsif.rb
masterview_parser-0.0.4 lib/masterview/directives/elsif.rb
masterview_parser-0.0.3 lib/masterview/directives/elsif.rb