Class: PlatformosCheck::Tags::Session
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- PlatformosCheck::Tags::Session
- Defined in:
- lib/platformos_check/tags/session.rb
Defined Under Namespace
Classes: ParseTreeVisitor
Constant Summary collapse
- SYNTAX =
/(#{Liquid::VariableSignature}+)\s*=\s*(.*)\s*/om
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
Instance Method Summary collapse
-
#initialize(tag_name, markup, options) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(tag_name, markup, options) ⇒ Session
Returns a new instance of Session.
10 11 12 13 14 15 16 |
# File 'lib/platformos_check/tags/session.rb', line 10 def initialize(tag_name, markup, ) 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), ) end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
8 9 10 |
# File 'lib/platformos_check/tags/session.rb', line 8 def from @from end |