Module: Wptemplates::Node

Included in:
Link, Soup, Template, Text
Defined in:
lib/wptemplates/ast.rb

Instance Method Summary collapse

Instance Method Details



28
29
30
# File 'lib/wptemplates/ast.rb', line 28

def all_links
  links
end

#all_templatesObject



7
8
9
# File 'lib/wptemplates/ast.rb', line 7

def all_templates
  templates
end

#all_templates_of(type) ⇒ Object



19
20
21
# File 'lib/wptemplates/ast.rb', line 19

def all_templates_of type
  all_templates.select{|t| t.name==type}
end

#deep_template_of(type) ⇒ Object



22
23
24
# File 'lib/wptemplates/ast.rb', line 22

def deep_template_of type
  all_templates_of(type).first
end


25
26
27
# File 'lib/wptemplates/ast.rb', line 25

def links
  []
end

#template_of(type) ⇒ Object



16
17
18
# File 'lib/wptemplates/ast.rb', line 16

def template_of type
  templates_of(type).first
end

#templatesObject



4
5
6
# File 'lib/wptemplates/ast.rb', line 4

def templates
  []
end

#templates_of(type) ⇒ Object



13
14
15
# File 'lib/wptemplates/ast.rb', line 13

def templates_of type
  templates.select{|t| t.name==type}
end

#textObject



10
11
12
# File 'lib/wptemplates/ast.rb', line 10

def text
  ""
end