class GoodData::Command::Domain

Low level access to GoodData API

Attributes

name[R]

Public Class Methods

add_user(domain, login, password, opts = { :client => GoodData.connection }) click to toggle source
# File lib/gooddata/commands/domain.rb, line 17
def add_user(domain, login, password, opts = { :client => GoodData.connection })
  data = {
    :domain => domain,
    :login => login,
    :password => password
  }
  GoodData::Domain.add_user(data.merge(opts))
end
list_users(domain_name, options = { :client => GoodData.connection }) click to toggle source
# File lib/gooddata/commands/domain.rb, line 26
def list_users(domain_name, options = { :client => GoodData.connection })
  client = GoodData.connect(options)
  domain = client.domain(domain_name)

  rows = domain.users.to_a.map do |user|
    [user.email, user.full_name]
  end

  table = Terminal::Table.new :headings => ['Email', 'Full Name'], :rows => rows
  puts table
end