Class: Liquid::Tag

Inherits:
Object
  • Object
show all
Includes:
ParserSwitching
Defined in:
lib/liquid/tag.rb

Direct Known Subclasses

Assign, Block, Break, Continue, Cycle, Decrement, Include, Increment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ParserSwitching

#parse_with_selected_parser

Constructor Details

#initialize(tag_name, markup, options) ⇒ Tag

Returns a new instance of Tag



17
18
19
20
21
# File 'lib/liquid/tag.rb', line 17

def initialize(tag_name, markup, options)
  @tag_name   = tag_name
  @markup     = markup
  @options    = options
end

Instance Attribute Details

#line_numberObject

Returns the value of attribute line_number



3
4
5
# File 'lib/liquid/tag.rb', line 3

def line_number
  @line_number
end

#nodelistObject (readonly)

Returns the value of attribute nodelist



4
5
6
# File 'lib/liquid/tag.rb', line 4

def nodelist
  @nodelist
end

#optionsObject

Returns the value of attribute options



3
4
5
# File 'lib/liquid/tag.rb', line 3

def options
  @options
end

#warningsObject (readonly)

Returns the value of attribute warnings



4
5
6
# File 'lib/liquid/tag.rb', line 4

def warnings
  @warnings
end

Class Method Details

.parse(tag_name, markup, tokens, options) ⇒ Object



8
9
10
11
12
# File 'lib/liquid/tag.rb', line 8

def parse(tag_name, markup, tokens, options)
  tag = new(tag_name, markup, options)
  tag.parse(tokens)
  tag
end

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/liquid/tag.rb', line 38

def blank?
  false
end

#nameObject



30
31
32
# File 'lib/liquid/tag.rb', line 30

def name
  self.class.name.downcase
end

#parse(tokens) ⇒ Object



23
24
# File 'lib/liquid/tag.rb', line 23

def parse(tokens)
end

#rawObject



26
27
28
# File 'lib/liquid/tag.rb', line 26

def raw
  "#{@tag_name} #{@markup}"
end

#render(context) ⇒ Object



34
35
36
# File 'lib/liquid/tag.rb', line 34

def render(context)
  ''.freeze
end