Class: Cyberweb::TagPrototype

Inherits:
Object
  • Object
show all
Defined in:
lib/cyberweb/standalone_classes/tag_prototype.rb

Overview

Cyberweb::TagPrototype

Instance Method Summary collapse

Constructor Details

#initialize(which_tag_to_use = '') ⇒ TagPrototype

#

initialize

#


20
21
22
# File 'lib/cyberweb/standalone_classes/tag_prototype.rb', line 20

def initialize(which_tag_to_use = '') # Pass the name of the tag here.
  set_tag_name(which_tag_to_use)
end

Instance Method Details

#id(i = @tag_name+'_id') ⇒ Object

#

id

#


34
35
36
# File 'lib/cyberweb/standalone_classes/tag_prototype.rb', line 34

def id(i = @tag_name+'_id') # this sets a name.
  '<'+@tag_name+' id="'+i+'">'+"\n"
end

#set_tag_name(i) ⇒ Object Also known as: name

#

set_tag_name

#


27
28
29
# File 'lib/cyberweb/standalone_classes/tag_prototype.rb', line 27

def set_tag_name(i) # Here we set which tag name we work on.
  @tag_name = i.to_s # We require the tag-name to be a String at all times.
end