Class: GoodData::Command::Domain
- Defined in:
- lib/gooddata/commands/domain.rb
Overview
Low level access to GoodData API
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- .add_user(domain, login, password, opts = { :client => GoodData.connection }) ⇒ Object
- .list_users(domain_name, options = { :client => GoodData.connection }) ⇒ Object
Instance Attribute Details
#name ⇒ Object (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, 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 }) ⇒ 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, = { :client => GoodData.connection }) client = GoodData.connect() 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 |