I have trouble understanding why my below code fails partially. I try to create Liquid tag for Jekyll. While the the class member "text" is set, the member "xyz" is not set at all. But why?
module MyModule
class MyTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
@xyz = "HELLO"
end
def render(context)
"Output #{@text} #{@xyz}"
end
end
end
Liquid::Template.register_tag('my_tag', MyModule::MyTag)
With calling the following
{% my_tag de 1234 %}
The output of the above is:
Output de 1234
I expected there would be "HELLO" as well, like:
Output de 1234 HELLO
What do I miss?
The original code from the Liquid class is here.