Class: Magellan::Cli::Resources::Project
- Includes:
- Deletable
- Defined in:
- lib/magellan/cli/resources/project.rb
Constant Summary
Constants included from FileAccess
FileAccess::DEFAULT_SELECTION_FILENAME
Instance Method Summary collapse
Methods included from Deletable
Methods included from FileAccess
ensure_config_dir, load_selection, load_selections, remove_selection_file, selection_filename, update_selections
Methods inherited from Base
command_help, help, log_error, log_info, log_success, log_verbose, log_warning, puts_with_color, sorted_commands, sorted_printable_commands, update_common_help_message
Instance Method Details
#create(name) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/magellan/cli/resources/project.rb', line 24 def create(name) o = load_selection!(Organization) params = { parameter_name => { "organization_id" => o["id"], "name" => name, } } post_json("/admin/#{resource_key}/new.json", params) select(name) end |
#update(attrs) ⇒ Object
17 18 19 20 21 |
# File 'lib/magellan/cli/resources/project.rb', line 17 def update(attrs) s = load_selection!(self.class) attrs = JSON.parse(File.readable?(attrs) ? File.read(attrs) : attrs) put_json("/admin/project/#{s['id']}/edit.json", {"project" => attrs}) end |