Class: Heroku::Command::Regions

Inherits:
Base
  • Object
show all
Defined in:
lib/heroku/command/regions.rb

Overview

list available regions

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#api, #app, #heroku, #initialize, namespace, #org, #org_api

Methods included from Helpers

#action, #app_owner, #ask, #confirm, #confirm_command, #create_git_remote, #debug, #debugging?, #default_org_host, #deprecate, #display, #display_header, #display_object, #display_row, #display_table, #error, #error_log, #error_log_path, error_with_failure, error_with_failure=, extended, extended_into, #fail, #format_bytes, #format_date, #format_error, #format_with_bang, #get_terminal_environment, #git, #has_git?, #has_git_remote?, #has_http_git_entry_in_netrc, #home_directory, #hprint, #hputs, included, included_into, #json_decode, #json_encode, #launchy, #line_formatter, #longest, #org?, #org_host, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #run_command, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #stderr_print, #stderr_puts, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #time_ago, #truncate, #update_git_remote, #warn_if_using_jruby, #with_tty

Constructor Details

This class inherits a constructor from Heroku::Command::Base

Instance Method Details

#indexObject

regions

List available regions for deployment

Example:

$ heroku regions

Regions

us eu


17
18
19
20
21
# File 'lib/heroku/command/regions.rb', line 17

def index
  regions = json_decode(heroku.get("/regions"))
  styled_header("Regions")
  styled_array(regions.map { |region| [region["slug"], region["name"]] })
end