Class: Clot::ClotTag

Inherits:
Liquid::Tag
  • Object
show all
Includes:
AttributeSetter, TagHelper
Defined in:
lib/clot/no_model_form_tags.rb

Instance Method Summary collapse

Methods included from TagHelper

#resolve_value, #split_params

Methods included from AttributeSetter

#personal_attributes, #set_attributes, #set_primary_attributes

Constructor Details

#initialize(name, params, tokens) ⇒ ClotTag

Returns a new instance of ClotTag.



51
52
53
54
# File 'lib/clot/no_model_form_tags.rb', line 51

def initialize(name, params, tokens)
  @_params = split_params(params)
  super
end

Instance Method Details

#render(context) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/clot/no_model_form_tags.rb', line 56

def render(context)


  instance_variables.map(&:to_sym).each do |var|
    unless [:@_params, :@markup, :@tag_name].include? var
      instance_variable_set var, nil  #this is because the same parse tag is re-rendered
    end
  end
  @params = @_params.clone
  set_attributes(context)
  render_string
end