Class: Sem::Views::Orgs

Inherits:
Base
  • Object
show all
Defined in:
lib/sem/views/orgs.rb

Class Method Summary collapse

Methods inherited from Base

org_names_not_matching, print_table

Class Method Details

.create_first_orgObject



3
4
5
6
7
8
# File 'lib/sem/views/orgs.rb', line 3

def self.create_first_org
  puts "You don't belong to any organization."
  puts ""
  puts "Create your first organization: https://semaphoreci.com/organizations/new."
  puts ""
end

.info(org) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/sem/views/orgs.rb', line 20

def self.info(org)
  print_table [
    ["ID", org.id],
    ["Name", org.username],
    ["Created", org.created_at],
    ["Updated", org.updated_at]
  ]
end

.list(orgs) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/sem/views/orgs.rb', line 10

def self.list(orgs)
  header = ["ID", "NAME"]

  body = orgs.map do |org|
    [org.id, org.username]
  end

  print_table [header, *body]
end