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.4.14 lib/platformos_check/tags/session.rb
platformos-check-0.4.13 lib/platformos_check/tags/session.rb
platformos-check-0.4.12 lib/platformos_check/tags/session.rb
platformos-check-0.4.11 lib/platformos_check/tags/session.rb
platformos-check-0.4.10 lib/platformos_check/tags/session.rb
platformos-check-0.4.9 lib/platformos_check/tags/session.rb
platformos-check-0.4.8 lib/platformos_check/tags/session.rb
platformos-check-0.4.7 lib/platformos_check/tags/session.rb
platformos-check-0.4.6 lib/platformos_check/tags/session.rb
platformos-check-0.4.5 lib/platformos_check/tags/session.rb
platformos-check-0.4.4 lib/platformos_check/tags/session.rb
platformos-check-0.4.3 lib/platformos_check/tags/session.rb
platformos-check-0.4.2 lib/platformos_check/tags/session.rb
platformos-check-0.4.1 lib/platformos_check/tags/session.rb
platformos-check-0.4.0 lib/platformos_check/tags/session.rb
platformos-check-0.3.3 lib/platformos_check/tags/session.rb
platformos-check-0.3.1 lib/platformos_check/tags/session.rb
platformos-check-0.3.0 lib/platformos_check/tags/session.rb
platformos-check-0.2.2 lib/platformos_check/tags/session.rb
platformos-check-0.2.1 lib/platformos_check/tags/session.rb