Class: Decidim::Admin::CreateImportExample

Inherits:
Command
  • Object
show all
Defined in:
decidim-admin/app/commands/decidim/admin/create_import_example.rb

Instance Method Summary collapse

Methods inherited from Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events

Constructor Details

#initialize(form) ⇒ CreateImportExample

Returns a new instance of CreateImportExample.



6
7
8
# File 'decidim-admin/app/commands/decidim/admin/create_import_example.rb', line 6

def initialize(form)
  @form = form
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Method Details

#callObject



10
11
12
13
14
# File 'decidim-admin/app/commands/decidim/admin/create_import_example.rb', line 10

def call
  return broadcast(:invalid) if form.invalid?

  broadcast(:ok, form.example)
end