Class: Magellan::Cli::Resources::Team
- Defined in:
- lib/magellan/cli/resources/team.rb
Instance Method Summary collapse
Methods included from FileAccess
#load_selection, #load_selections, #update_selections
Instance Method Details
#create(name, role) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/magellan/cli/resources/team.rb', line 14 def create(name, role) unless %w{ reader admin }.include?(role) raise "ROLE should be 'reader' or 'admin'" end o = load_selection(Organization.parameter_name) params = { parameter_name => { "organization_id" => o["id"], "name" => name, "role" => role, } } post_json("/admin/#{self.resource_name}/new.json", params) select(name) end |