Class: GoodData::Command::Domain

Inherits:
Object
  • Object
show all
Defined in:
lib/gooddata/commands/domain.rb

Overview

Low level access to GoodData API

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/gooddata/commands/domain.rb', line 14

def name
  @name
end

Class Method Details

.add_user(domain, login, password, opts = { :client => GoodData.connection }) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/gooddata/commands/domain.rb', line 17

def add_user(domain, , password, opts = { :client => GoodData.connection })
  data = {
    :domain => domain,
    :login => ,
    :password => password
  }
  GoodData::Domain.add_user(data.merge(opts))
end

.list_users(domain_name, options = { :client => GoodData.connection }) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# 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