Class: Gzr::Commands::Look::Rm

Inherits:
Gzr::Command show all
Includes:
Look
Defined in:
lib/gzr/commands/look/rm.rb

Instance Method Summary collapse

Methods included from Look

#create_fetch_query, #create_look, #create_merge_result, #delete_look, #query_look, #search_looks_by_slug, #search_looks_by_title, #update_look, #upsert_look

Methods inherited from Gzr::Command

#create_merge_query, #create_query, #field_expression, #field_names, #keys_to_keep, #merge_query, #pairs, #query, #render_csv, #run_inline_query

Methods included from Session

#build_connection_hash, #login, #logout_all, #pastel, #say_error, #say_ok, #say_warning, #v3_1_available?, #with_session

Constructor Details

#initialize(look_id, options) ⇒ Rm

Returns a new instance of Rm.



32
33
34
35
36
# File 'lib/gzr/commands/look/rm.rb', line 32

def initialize(look_id, options)
  super()
  @look_id = look_id
  @options = options
end

Instance Method Details

#execute(input: $stdin, output: $stdout) ⇒ Object



38
39
40
41
42
43
# File 'lib/gzr/commands/look/rm.rb', line 38

def execute(input: $stdin, output: $stdout)
  say_warning("options: #{@options.inspect}") if @options[:debug]
    with_session do
    delete_look(@look_id)
  end
end