Class: SWS::Conditional
- Defined in:
- lib/sws/Core/components/Conditional/Conditional.rb
Overview
Represents content that is rendered conditionally. Bindings:
-
condition (required) - if true, the content will be rendered
-
negate - if true, the condition is reversed
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
-
#append_to_response(response) ⇒ Object
The content of this component is appended to response only if value of only one of “condition” and “negate” slots evaluates to true.
- #create_component_tree ⇒ Object
- #process_bindings ⇒ Object
Methods inherited from Component
#api_filename, #app, #awake, #container?, #content?, create, #definition_filename, #initialize, #page, #perform_action, #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
The content of this component is appended to response only if value of only one of “condition” and “negate” slots evaluates to true.
22 23 24 |
# File 'lib/sws/Core/components/Conditional/Conditional.rb', line 22 def append_to_response ( response ) if ( render_content? ) then super end end |
#create_component_tree ⇒ Object
15 16 17 |
# File 'lib/sws/Core/components/Conditional/Conditional.rb', line 15 def create_component_tree () if ( render_content? ) then super end end |
#process_bindings ⇒ Object
10 11 12 |
# File 'lib/sws/Core/components/Conditional/Conditional.rb', line 10 def process_bindings () if ( render_content? ) then super end end |