Class: ServerComponent::FetcherConfigurator
- Inherits:
-
Object
- Object
- ServerComponent::FetcherConfigurator
- Includes:
- ServerComponentHelper
- Defined in:
- lib/server_component/component.rb
Instance Method Summary collapse
- #accept_file! ⇒ Object
- #before ⇒ Object
-
#initialize(component_class, actions) ⇒ FetcherConfigurator
constructor
A new instance of FetcherConfigurator.
- #set_value(key, value) ⇒ Object
Methods included from ServerComponentHelper
Constructor Details
#initialize(component_class, actions) ⇒ FetcherConfigurator
7 8 9 10 |
# File 'lib/server_component/component.rb', line 7 def initialize(component_class, actions) @component_class = component_class @actions = actions end |
Instance Method Details
#accept_file! ⇒ Object
20 21 22 |
# File 'lib/server_component/component.rb', line 20 def accept_file! set_value :upload, true end |
#before ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/server_component/component.rb', line 12 def before jsrb = Jsrb::Base.new set_state(jsrb) do |s| yield(s, jsrb.expr.context.data) end set_value(:start_function, jsrb.generate_code) end |
#set_value(key, value) ⇒ Object
24 25 26 27 28 |
# File 'lib/server_component/component.rb', line 24 def set_value(key, value) @actions.each do |action| @component_class.action_descriptors[action][key] = value end end |