Class: AdminModule::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/admin_module/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#page_factoryObject



74
75
76
# File 'lib/admin_module/client.rb', line 74

def page_factory
  @page_factory ||= AdminModule::PageFactory.new
end

#password=(value) ⇒ Object (writeonly)

Sets the attribute password

Parameters:

  • value

    the value to set the attribute password to.



19
20
21
# File 'lib/admin_module/client.rb', line 19

def password=(value)
  @password = value
end

#user=(value) ⇒ Object (writeonly)

Override credentials



18
19
20
# File 'lib/admin_module/client.rb', line 18

def user=(value)
  @user = value
end

Instance Method Details

#dcsObject



54
55
56
57
# File 'lib/admin_module/client.rb', line 54

def dcs
  
  DC.new page_factory
end

#envObject



25
26
27
# File 'lib/admin_module/client.rb', line 25

def env
  AdminModule.configuration.current_env
end

#env=(environment) ⇒ Object



21
22
23
# File 'lib/admin_module/client.rb', line 21

def env=(environment)
  AdminModule.configuration.current_env = environment
end

#guidelineObject



29
30
31
32
# File 'lib/admin_module/client.rb', line 29

def guideline
  
  Guideline.new page_factory
end

#locksObject



44
45
46
47
# File 'lib/admin_module/client.rb', line 44

def locks
  
  Locks.new page_factory
end

#login(user = nil, pass = nil) ⇒ Object

Login to the admin module.

If no credentials are provided, try to get credentials from the config object.



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/admin_module/client.rb', line 84

def (user = nil, pass = nil)
  if @logged_in
    return true
  end

  user, pass = verify_credentials user, pass

  logout
  page_factory.(true).(user, pass)
  @logged_in = true
end

#logoutObject

Logout of the admin module



100
101
102
103
# File 'lib/admin_module/client.rb', line 100

def logout
  page_factory.(true).logout
  @logged_in = false
end

#ppmsObject



69
70
71
72
# File 'lib/admin_module/client.rb', line 69

def ppms
  
  Ppms.new page_factory
end

#quitObject

Logout of the admin module and quit the browser



109
110
111
112
# File 'lib/admin_module/client.rb', line 109

def quit
  logout
  page_factory.(false).browser.close
end

#rulesObject



39
40
41
42
# File 'lib/admin_module/client.rb', line 39

def rules
  
  Rules.new page_factory
end

#rulesetsObject



34
35
36
37
# File 'lib/admin_module/client.rb', line 34

def rulesets
  
  Rulesets.new page_factory
end

#snapshotsObject



59
60
61
62
# File 'lib/admin_module/client.rb', line 59

def snapshots
  
  Snapshots.new page_factory
end

#stagesObject



49
50
51
52
# File 'lib/admin_module/client.rb', line 49

def stages
  
  Stages.new page_factory
end

#tasksObject



64
65
66
67
# File 'lib/admin_module/client.rb', line 64

def tasks
  
  Tasks.new page_factory
end