Class: Deklarativna::NestingRenderable

Inherits:
Renderable
  • Object
show all
Defined in:
lib/deklarativna_core.rb

Overview

Public Class This class is intended to render tags following the ‘<tagname></tagname>’ pattern

Direct Known Subclasses

CommentRenderable

Instance Attribute Summary collapse

Attributes inherited from Renderable

#attributes, #tag_name

Instance Method Summary collapse

Methods inherited from Renderable

#initialize, #render_attributes

Constructor Details

This class inherits a constructor from Deklarativna::Renderable

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#_proc_callObject



43
44
45
46
47
48
# File 'lib/deklarativna_core.rb', line 43

def _proc_call
  if @content.call.respond_to? :join
    return @content.call.join("")
  end
  @content.call
end

#proc_callObject



36
37
38
39
40
41
# File 'lib/deklarativna_core.rb', line 36

def proc_call
  if @content.nil?
    return ""
  end
  _proc_call
end

#to_sObject



32
33
34
# File 'lib/deklarativna_core.rb', line 32

def to_s
  "<#{@tag_name}#{render_attributes}>#{proc_call}</#{@tag_name}>"
end