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

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

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