Class: PostyCli::Command::Domain

Inherits:
Thor
  • Object
show all
Defined in:
lib/posty_cli/command/domain.rb

Instance Method Summary collapse

Instance Method Details

#add(name) ⇒ Object


28
29
30
31
# File 'lib/posty_cli/command/domain.rb', line 28

def add(name)
	json = {name: name}.to_json
	PostyCli::Util::Domain.create(json, name)
end

#delete(name) ⇒ Object


50
51
52
53
54
# File 'lib/posty_cli/command/domain.rb', line 50

def delete(name)
	if(yes? "Are you sure you want to delete #{name}? Yes\\No")
	PostyCli::Util::Domain.delete(name)				
	end
end

#edit(name, new_name) ⇒ Object


39
40
41
42
# File 'lib/posty_cli/command/domain.rb', line 39

def edit(name, new_name)
	json = {name: new_name}.to_json
	PostyCli::Util::Domain.edit(name, json, new_name)
end

#listObject


14
15
16
17
# File 'lib/posty_cli/command/domain.rb', line 14

def list
	out = PostyCli::Util::Domain.get_all
	print_table(out)
end