Class: Ecm::Cms::CreateNavigationService
- Inherits:
-
Itsf::Services::V2::Service::Base
- Object
- Itsf::Services::V2::Service::Base
- Ecm::Cms::CreateNavigationService
- Defined in:
- app/services/ecm/cms/create_navigation_service.rb
Defined Under Namespace
Classes: Response
Instance Attribute Summary collapse
-
#items_attributes ⇒ Object
Returns the value of attribute items_attributes.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#items_attributes ⇒ Object
Returns the value of attribute items_attributes.
14 15 16 |
# File 'app/services/ecm/cms/create_navigation_service.rb', line 14 def items_attributes @items_attributes end |
#locale ⇒ Object
Returns the value of attribute locale.
14 15 16 |
# File 'app/services/ecm/cms/create_navigation_service.rb', line 14 def locale @locale end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'app/services/ecm/cms/create_navigation_service.rb', line 14 def name @name end |
Instance Method Details
#do_work ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/services/ecm/cms/create_navigation_service.rb', line 18 def do_work info "Running on environment #{Rails.env}" return response unless valid? @navigation = @navigation_items = @navigation_items.collect do || if .save info "Created #{}", indent: 1 response. << else add_error_and_say :base, "Error creating #{}. Errors: #{.errors..to_sentence}", indent: 1 response. << end end response. = @navigation response. = @navigation_items info 'Done' return response end |