Class: Locomotive::Wagon::PushSnippetsCommand
- Inherits:
-
PushBaseCommand
show all
- Defined in:
- lib/locomotive/wagon/commands/push_sub_commands/push_snippets_command.rb
Instance Attribute Summary
#api_client, #content_assets_pusher, #filter, #remote_site, #steam_services
Instance Method Summary
collapse
#_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_snippets_command.rb', line 9
def decorate(entity)
SnippetDecorator.new(entity, locale, content_assets_pusher)
end
|
#entities ⇒ Object
5
6
7
|
# File 'lib/locomotive/wagon/commands/push_sub_commands/push_snippets_command.rb', line 5
def entities
repositories.snippet.all
end
|
#label_for(decorated_entity) ⇒ Object
17
18
19
|
# File 'lib/locomotive/wagon/commands/push_sub_commands/push_snippets_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_snippets_command.rb', line 13
def persist(decorated_entity)
api_client.snippets.update(decorated_entity.slug, decorated_entity.to_hash)
end
|