Class: SWS::String

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

Overview

Represents some text to be rendered literally in HTML. Very commonly used component. Bindings:

  • value (required) - string to display

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, #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

#append_to_response(response) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/sws/Core/components/String/String.rb', line 10

def append_to_response ( response )

	value = @slots["value"].value.to_s
	if ( @slots["escape_html"].value )
		value.gsub!( /</,"&lt;" )
		value.gsub!( />/,"&gt;" )
	end
	response << value

end

#container?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/sws/Core/components/String/String.rb', line 22

def container? ()
	return false
end