class Deklarativna::Renderable

Abstract Class

Base Class for all renderables

Attributes

attributes[RW]
tag_name[RW]

Public Class Methods

new(&initialization_block) click to toggle source
# File lib/deklarativna_core.rb, line 8
def initialize &initialization_block
  initialization_block.call self
end

Public Instance Methods

render_attributes() click to toggle source
Private Method

This method renders the attributes for any Renderable class

# File lib/deklarativna_core.rb, line 14
def render_attributes
  rendering_tags = []
  attribute_list = @attributes.sort if @attributes.respond_to? :sort
  if attribute_list.respond_to? :each
    attribute_list.each do |e|
      rendering_tags.push "#{e[0]}=\"#{e[1]}\""
    end
  end
  return " " + (rendering_tags.join " ") if !rendering_tags.empty?
end