Class: SWS::GenericContainer

Inherits:
Component show all
Defined in:
lib/sws/Core/components/GenericContainer/GenericContainer.rb

Overview

Represents a custom container component. Used to display HTML tags that do not (yet) have dedicated components. Bindings:

  • tag_name (required) - name of the tag to use

  • class - CSS class of the tag

  • name - name attribute of the tag

  • other_tag_string - generic string to add to the tag

Instance Attribute Summary

Attributes inherited from Component

#action_components, #definition_component, #encoding, #html_attrs, #method_to_call, #name, #parameters, #parent, #request, #request_number, #slots, #subcomponents, #tokens

Instance Method Summary collapse

Methods inherited from Component

#api_filename, #app, #append_to_response, #awake, #content?, create, #create_component_tree, #definition_filename, #initialize, #page, #perform_action, #process_bindings, #process_parameters, #process_request, #remove_subcomponents, #session, #set_request_subcomponents, #sleep, #slot_bound?, #subcomponent_for_name, synchronize_slot, #synchronize_slot?, #synchronize_slots, #template_filename, #tokenize_binding, #update_binding, #url_string

Constructor Details

This class inherits a constructor from SWS::Component

Instance Method Details

#container?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/sws/Core/components/GenericContainer/GenericContainer.rb', line 13

def container? ()
	return true
end

#prefixObject



18
19
20
21
22
23
24
25
26
# File 'lib/sws/Core/components/GenericContainer/GenericContainer.rb', line 18

def prefix ()

	tag_name = @slots["tag_name"].value()
	string = "<#{tag_name}"
	string << bound_slot_string( "class","name","id" )
	string << generic_attr_string() << ">"
	return string

end

#suffixObject



29
30
31
32
33
34
# File 'lib/sws/Core/components/GenericContainer/GenericContainer.rb', line 29

def suffix ()

	tag_name = @slots["tag_name"].value()
	return "</#{tag_name}>"

end