Class: Ralph::CLI::Commands::Delete

Inherits:
Base
  • Object
show all
Defined in:
lib/ralph/cli/commands/delete.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#gen_client

Class Attribute Details

.pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/ralph/cli/commands/delete.rb', line 4

def path
  @path
end

Instance Method Details

#call(**options) ⇒ Object



13
14
15
16
17
18
# File 'lib/ralph/cli/commands/delete.rb', line 13

def call(**options)
  client = gen_client
  if id = options[:id]
    puts JSON.dump(client.delete("#{path}#{id}/").body)
  end
end

#pathObject



6
7
8
# File 'lib/ralph/cli/commands/delete.rb', line 6

def path
  self.class.path
end

#path=(v) ⇒ Object



9
10
11
# File 'lib/ralph/cli/commands/delete.rb', line 9

def path=(v)
  self.class.path = v
end