Sha256: d3c130fc7ea8a0e6819ae32a9c9537ddfa334c98ea30030f1e1fea234a2d5054

Contents?: true

Size: 659 Bytes

Versions: 25

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

module PlatformosCheck
  module Tags
    class Session < Liquid::Tag
      SYNTAX = /(#{Liquid::VariableSignature}+)\s*=\s*(.*)\s*/om

      attr_reader :from

      def initialize(tag_name, markup, options)
        super
        raise Liquid::SyntaxError, "Syntax Error in 'session' - Valid syntax: session [var1] = [var2]" unless markup =~ SYNTAX

        @to = Regexp.last_match(1)
        @from = Liquid::Variable.new(Regexp.last_match(2), options)
      end

      class ParseTreeVisitor < Liquid::ParseTreeVisitor
        def children
          [
            @node.from
          ]
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
platformos-check-0.2.0 lib/platformos_check/tags/session.rb
platformos-check-0.1.0 lib/platformos_check/tags/session.rb
platformos-check-0.0.3 lib/platformos_check/tags/session.rb
platformos-check-0.0.2 lib/platformos_check/tags/session.rb
platformos-check-0.0.1 lib/platformos_check/tags/session.rb