Class: QuickBase::Objects::Application

Inherits:
Table
  • Object
show all
Defined in:
lib/QuickBaseObjects.rb

Overview

An Application, which is a Table with child Tables, Pages, Roles, Variables.

Instance Attribute Summary collapse

Attributes inherited from Table

#dbid, #desc, #fields, #info, #name, #pnoun, #queries, #tables

Instance Method Summary collapse

Methods inherited from Table

#addField, #addFieldMethods, #addPageMethods, #addTableMethods, #addUserMethods, #addVariableMethods, #build, #buildAppInfo, #buildField, #buildFields, #buildInfo, #buildInfoField, #buildPage, #buildPages, #buildQueries, #buildQuery, #buildRole, #buildRoles, #buildTable, #buildTables, #buildUser, #buildUsers, #buildVariable, #buildVariables, #deleteField, #initialize, #removeFieldMethods, #runImport

Constructor Details

This class inherits a constructor from QuickBase::Objects::Table

Instance Attribute Details

#pagesObject (readonly)

Returns the value of attribute pages.



411
412
413
# File 'lib/QuickBaseObjects.rb', line 411

def pages
  @pages
end

#rolesObject (readonly)

Returns the value of attribute roles.



411
412
413
# File 'lib/QuickBaseObjects.rb', line 411

def roles
  @roles
end

#usersObject (readonly)

Returns the value of attribute users.



411
412
413
# File 'lib/QuickBaseObjects.rb', line 411

def users
  @users
end

#variablesObject (readonly)

Returns the value of attribute variables.



411
412
413
# File 'lib/QuickBaseObjects.rb', line 411

def variables
  @variables
end

Instance Method Details

#addPage(page) ⇒ Object



423
424
425
426
427
428
429
# File 'lib/QuickBaseObjects.rb', line 423

def addPage(page)
  raise "#{page} is not a Page object" if !is_a?(Page)
  pageid = @qbc.addReplaceDBPage(@dbid,nil,page.name, page.type, page.content)
  page.build( {"id" => pageid})
  @pages[pageid] = page
  addPageMethods(page)
end

#addTable(table) ⇒ Object



412
413
414
415
416
417
# File 'lib/QuickBaseObjects.rb', line 412

def addTable(table)
  raise "#{table} is not a Table object" if !is_a?(Table)
  newdbid = @qbc.createTable(@dbid, table.pnoun)
  @tables[newdbid] = table
  addTableMethods(table)
end

#addUser(role, email, fname, lname, message) ⇒ Object



430
431
432
433
434
435
436
437
438
439
# File 'lib/QuickBaseObjects.rb', line 430

def addUser(role,email,fname,lname,message)
    raise "#{role} is not a Role object" if !is_a?(Role)
    userid = @qbc.provisionUser(@dbid, role.id, email, fname, lname)
    if userid
       if @qbc.sendInvitation(@dbid, userid, message) 
           user = User.new
           user.addInfo(qbc,email)
       end  
    end
end

#addVariable(variable) ⇒ Object



418
419
420
421
422
# File 'lib/QuickBaseObjects.rb', line 418

def addVariable(variable)
  raise "#{variable} is not a Variable object" if !is_a?(Variable)
  @variables[variable.name] = variable
  addVariableMethods(variable)
end

#rename(newappname) ⇒ Object



440
441
442
# File 'lib/QuickBaseObjects.rb', line 440

def rename(newappname)
    @qbc.renameApp(@dbid, newappname)
end