Class: Locomotive::Wagon::PushSectionsCommand

Inherits:
PushBaseCommand show all
Defined in:
lib/locomotive/wagon/commands/push_sub_commands/push_sections_command.rb

Instance Attribute Summary

Attributes inherited from PushBaseCommand

#api_client, #content_assets_pusher, #filter, #remote_site, #steam_services

Instance Method Summary collapse

Methods inherited from PushBaseCommand

#_push, #_push_with_timezone, #default_locale, #instrument, #locales, #only, #path, push, #push, #resource_name, #with_data, #with_data?

Instance Method Details

#decorate(entity) ⇒ Object



9
10
11
# File 'lib/locomotive/wagon/commands/push_sub_commands/push_sections_command.rb', line 9

def decorate(entity)
  SectionDecorator.new(entity, content_assets_pusher)
end

#entitiesObject



5
6
7
# File 'lib/locomotive/wagon/commands/push_sub_commands/push_sections_command.rb', line 5

def entities
  repositories.section.all
end

#label_for(decorated_entity) ⇒ Object



17
18
19
# File 'lib/locomotive/wagon/commands/push_sub_commands/push_sections_command.rb', line 17

def label_for(decorated_entity)
  decorated_entity.name
end

#persist(decorated_entity) ⇒ Object



13
14
15
# File 'lib/locomotive/wagon/commands/push_sub_commands/push_sections_command.rb', line 13

def persist(decorated_entity)
  api_client.sections.update(decorated_entity.slug, decorated_entity.to_hash)
end