Class: Decidim::DecidimAwesome::Admin::CreateScopedStyle
- Includes:
- NeedsConstraintHelpers
- Defined in:
- app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(organization, config_var = :scoped_styles) ⇒ CreateScopedStyle
constructor
Public: Initializes the command.
Constructor Details
#initialize(organization, config_var = :scoped_styles) ⇒ CreateScopedStyle
Public: Initializes the command.
10 11 12 13 |
# File 'app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb', line 10 def initialize(organization, config_var = :scoped_styles) @organization = organization @config_var = config_var end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if we couldn’t proceed.
Returns nothing.
21 22 23 24 25 26 27 |
# File 'app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb', line 21 def call create_hash_config!("") broadcast(:ok, ident) rescue StandardError => e broadcast(:invalid, e.) end |