Class: TestCentricity::Environ
- Inherits:
-
DataObject
- Object
- DataObject
- TestCentricity::Environ
- Defined in:
- lib/testcentricity_web/environment.rb
Instance Attribute Summary collapse
-
#append ⇒ Object
Returns the value of attribute append.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#db_password ⇒ Object
Returns the value of attribute db_password.
-
#db_username ⇒ Object
Returns the value of attribute db_username.
-
#device ⇒ Object
Returns the value of attribute device.
-
#device_type ⇒ Object
Returns the value of attribute device_type.
-
#dns ⇒ Object
Returns the value of attribute dns.
-
#external_page ⇒ Object
Returns the value of attribute external_page.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#option1 ⇒ Object
Returns the value of attribute option1.
-
#option2 ⇒ Object
Returns the value of attribute option2.
-
#os ⇒ Object
Returns the value of attribute os.
-
#password ⇒ Object
Returns the value of attribute password.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#portal_context ⇒ Object
Returns the value of attribute portal_context.
-
#portal_status ⇒ Object
Returns the value of attribute portal_status.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#signed_in ⇒ Object
Returns the value of attribute signed_in.
-
#test_environment ⇒ Object
Returns the value of attribute test_environment.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Attributes inherited from DataObject
#context, #current, #hash_table
Class Method Summary collapse
- .browser ⇒ Object
- .browser=(browser) ⇒ Object
- .device=(device) ⇒ Object
- .device_type ⇒ Object
- .device_type=(type) ⇒ Object
- .external_page ⇒ Object
- .get_screen_shots ⇒ Object
- .is_desktop? ⇒ Boolean
- .is_device? ⇒ Boolean
- .is_mobile? ⇒ Boolean
- .is_signed_in? ⇒ Boolean
- .os ⇒ Object
- .os=(os) ⇒ Object
- .platform=(platform) ⇒ Object
- .portal_context ⇒ Object
- .portal_context=(portal_context) ⇒ Object
- .portal_state ⇒ Object
- .portal_state=(portal_state) ⇒ Object
- .reset_contexts ⇒ Object
- .save_screen_shot(screen_shot) ⇒ Object
- .session_code ⇒ Object
- .session_id ⇒ Object
- .session_time_stamp ⇒ Object
-
.set_browser(browser) ⇒ Object
deprecated
Deprecated.
Please use #browser= instead
-
.set_device(device) ⇒ Object
deprecated
Deprecated.
Please use #device= instead
-
.set_device_type(type) ⇒ Object
deprecated
Deprecated.
Please use #device_type= instead
- .set_external_page(state) ⇒ Object
-
.set_os(os) ⇒ Object
deprecated
Deprecated.
Please use #os= instead
-
.set_platform(platform) ⇒ Object
deprecated
Deprecated.
Please use #platform= instead
-
.set_portal_context(portal_context) ⇒ Object
deprecated
Deprecated.
Please use #portal_context= instead
-
.set_portal_state(portal_state) ⇒ Object
deprecated
Deprecated.
Please use #portal_state= instead
- .set_signed_in(signed_in) ⇒ Object
- .test_environment ⇒ Object
Instance Method Summary collapse
-
#initialize(data) ⇒ Environ
constructor
A new instance of Environ.
Methods inherited from DataObject
current, current=, set_current
Constructor Details
#initialize(data) ⇒ Environ
Returns a new instance of Environ.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/testcentricity_web/environment.rb', line 52 def initialize(data) @protocol = data['PROTOCOL'] @hostname = data['HOST_NAME'] @base_url = data['BASE_URL'] @user_id = data['USER_ID'] @password = data['PASSWORD'] @append = data['APPEND'] @option1 = data['OPTIONAL_1'] @option2 = data['OPTIONAL_2'] @dns = data['DNS'] @db_username = data['DB_USERNAME'] @db_password = data['DB_PASSWORD'] super end |
Instance Attribute Details
#append ⇒ Object
Returns the value of attribute append.
45 46 47 |
# File 'lib/testcentricity_web/environment.rb', line 45 def append @append end |
#base_url ⇒ Object
Returns the value of attribute base_url.
42 43 44 |
# File 'lib/testcentricity_web/environment.rb', line 42 def base_url @base_url end |
#browser ⇒ Object
Returns the value of attribute browser.
30 31 32 |
# File 'lib/testcentricity_web/environment.rb', line 30 def browser @browser end |
#db_password ⇒ Object
Returns the value of attribute db_password.
50 51 52 |
# File 'lib/testcentricity_web/environment.rb', line 50 def db_password @db_password end |
#db_username ⇒ Object
Returns the value of attribute db_username.
49 50 51 |
# File 'lib/testcentricity_web/environment.rb', line 49 def db_username @db_username end |
#device ⇒ Object
Returns the value of attribute device.
32 33 34 |
# File 'lib/testcentricity_web/environment.rb', line 32 def device @device end |
#device_type ⇒ Object
Returns the value of attribute device_type.
33 34 35 |
# File 'lib/testcentricity_web/environment.rb', line 33 def device_type @device_type end |
#dns ⇒ Object
Returns the value of attribute dns.
48 49 50 |
# File 'lib/testcentricity_web/environment.rb', line 48 def dns @dns end |
#external_page ⇒ Object
Returns the value of attribute external_page.
38 39 40 |
# File 'lib/testcentricity_web/environment.rb', line 38 def external_page @external_page end |
#hostname ⇒ Object
Returns the value of attribute hostname.
41 42 43 |
# File 'lib/testcentricity_web/environment.rb', line 41 def hostname @hostname end |
#option1 ⇒ Object
Returns the value of attribute option1.
46 47 48 |
# File 'lib/testcentricity_web/environment.rb', line 46 def option1 @option1 end |
#option2 ⇒ Object
Returns the value of attribute option2.
47 48 49 |
# File 'lib/testcentricity_web/environment.rb', line 47 def option2 @option2 end |
#os ⇒ Object
Returns the value of attribute os.
31 32 33 |
# File 'lib/testcentricity_web/environment.rb', line 31 def os @os end |
#password ⇒ Object
Returns the value of attribute password.
44 45 46 |
# File 'lib/testcentricity_web/environment.rb', line 44 def password @password end |
#platform ⇒ Object
Returns the value of attribute platform.
34 35 36 |
# File 'lib/testcentricity_web/environment.rb', line 34 def platform @platform end |
#portal_context ⇒ Object
Returns the value of attribute portal_context.
37 38 39 |
# File 'lib/testcentricity_web/environment.rb', line 37 def portal_context @portal_context end |
#portal_status ⇒ Object
Returns the value of attribute portal_status.
36 37 38 |
# File 'lib/testcentricity_web/environment.rb', line 36 def portal_status @portal_status end |
#protocol ⇒ Object
Returns the value of attribute protocol.
40 41 42 |
# File 'lib/testcentricity_web/environment.rb', line 40 def protocol @protocol end |
#signed_in ⇒ Object
Returns the value of attribute signed_in.
35 36 37 |
# File 'lib/testcentricity_web/environment.rb', line 35 def signed_in @signed_in end |
#test_environment ⇒ Object
Returns the value of attribute test_environment.
29 30 31 |
# File 'lib/testcentricity_web/environment.rb', line 29 def test_environment @test_environment end |
#user_id ⇒ Object
Returns the value of attribute user_id.
43 44 45 |
# File 'lib/testcentricity_web/environment.rb', line 43 def user_id @user_id end |
Class Method Details
.browser ⇒ Object
101 102 103 |
# File 'lib/testcentricity_web/environment.rb', line 101 def self.browser @browser end |
.browser=(browser) ⇒ Object
97 98 99 |
# File 'lib/testcentricity_web/environment.rb', line 97 def self.browser=(browser) @browser = browser.downcase.to_sym end |
.device=(device) ⇒ Object
125 126 127 |
# File 'lib/testcentricity_web/environment.rb', line 125 def self.device=(device) @device = device end |
.device_type ⇒ Object
143 144 145 |
# File 'lib/testcentricity_web/environment.rb', line 143 def self.device_type @device_type end |
.device_type=(type) ⇒ Object
139 140 141 |
# File 'lib/testcentricity_web/environment.rb', line 139 def self.device_type=(type) @device_type = type.downcase end |
.external_page ⇒ Object
205 206 207 |
# File 'lib/testcentricity_web/environment.rb', line 205 def self.external_page @external_page end |
.get_screen_shots ⇒ Object
213 214 215 |
# File 'lib/testcentricity_web/environment.rb', line 213 def self.get_screen_shots @screen_shots end |
.is_desktop? ⇒ Boolean
161 162 163 |
# File 'lib/testcentricity_web/environment.rb', line 161 def self.is_desktop? @platform == :desktop end |
.is_device? ⇒ Boolean
129 130 131 |
# File 'lib/testcentricity_web/environment.rb', line 129 def self.is_device? @device end |
.is_mobile? ⇒ Boolean
157 158 159 |
# File 'lib/testcentricity_web/environment.rb', line 157 def self.is_mobile? @platform == :mobile end |
.is_signed_in? ⇒ Boolean
169 170 171 |
# File 'lib/testcentricity_web/environment.rb', line 169 def self.is_signed_in? @signed_in end |
.os ⇒ Object
115 116 117 |
# File 'lib/testcentricity_web/environment.rb', line 115 def self.os @os end |
.os=(os) ⇒ Object
111 112 113 |
# File 'lib/testcentricity_web/environment.rb', line 111 def self.os=(os) @os = os end |
.platform=(platform) ⇒ Object
153 154 155 |
# File 'lib/testcentricity_web/environment.rb', line 153 def self.platform=(platform) @platform = platform end |
.portal_context ⇒ Object
197 198 199 |
# File 'lib/testcentricity_web/environment.rb', line 197 def self.portal_context @portal_context end |
.portal_context=(portal_context) ⇒ Object
193 194 195 |
# File 'lib/testcentricity_web/environment.rb', line 193 def self.portal_context=(portal_context) @portal_context = portal_context end |
.portal_state ⇒ Object
183 184 185 |
# File 'lib/testcentricity_web/environment.rb', line 183 def self.portal_state @portal_status end |
.portal_state=(portal_state) ⇒ Object
179 180 181 |
# File 'lib/testcentricity_web/environment.rb', line 179 def self.portal_state=(portal_state) @portal_status = portal_state end |
.reset_contexts ⇒ Object
217 218 219 |
# File 'lib/testcentricity_web/environment.rb', line 217 def self.reset_contexts @screen_shots = [] end |
.save_screen_shot(screen_shot) ⇒ Object
209 210 211 |
# File 'lib/testcentricity_web/environment.rb', line 209 def self.save_screen_shot(screen_shot) @screen_shots.push(screen_shot) end |
.session_code ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/testcentricity_web/environment.rb', line 67 def self.session_code if @session_code.nil? characters = ('a'..'z').to_a @session_code = (0..12).map { characters.sample }.join end @session_code end |
.session_id ⇒ Object
75 76 77 |
# File 'lib/testcentricity_web/environment.rb', line 75 def self.session_id @session_id end |
.session_time_stamp ⇒ Object
79 80 81 |
# File 'lib/testcentricity_web/environment.rb', line 79 def self.session_time_stamp @session_time_stamp end |
.set_browser(browser) ⇒ Object
Please use #browser= instead
92 93 94 95 |
# File 'lib/testcentricity_web/environment.rb', line 92 def self.set_browser(browser) warn "[DEPRECATION] 'TestCentricity::Environ.set_browser' is deprecated. Please use 'browser=' instead." @browser = browser.downcase.to_sym end |
.set_device(device) ⇒ Object
Please use #device= instead
120 121 122 123 |
# File 'lib/testcentricity_web/environment.rb', line 120 def self.set_device(device) warn "[DEPRECATION] 'TestCentricity::Environ.set_device' is deprecated. Please use 'device=' instead." @device = device end |
.set_device_type(type) ⇒ Object
Please use #device_type= instead
134 135 136 137 |
# File 'lib/testcentricity_web/environment.rb', line 134 def self.set_device_type(type) warn "[DEPRECATION] 'TestCentricity::Environ.set_device_type' is deprecated. Please use 'device_type=' instead." @device_type = type.downcase end |
.set_external_page(state) ⇒ Object
201 202 203 |
# File 'lib/testcentricity_web/environment.rb', line 201 def self.set_external_page(state) @external_page = state end |
.set_os(os) ⇒ Object
Please use #os= instead
106 107 108 109 |
# File 'lib/testcentricity_web/environment.rb', line 106 def self.set_os(os) warn "[DEPRECATION] 'TestCentricity::Environ.set_os' is deprecated. Please use 'os=' instead." @os = os end |
.set_platform(platform) ⇒ Object
Please use #platform= instead
148 149 150 151 |
# File 'lib/testcentricity_web/environment.rb', line 148 def self.set_platform(platform) warn "[DEPRECATION] 'TestCentricity::Environ.set_platform' is deprecated. Please use 'platform=' instead." @platform = platform end |
.set_portal_context(portal_context) ⇒ Object
Please use #portal_context= instead
188 189 190 191 |
# File 'lib/testcentricity_web/environment.rb', line 188 def self.set_portal_context(portal_context) warn "[DEPRECATION] 'TestCentricity::Environ.set_portal_context' is deprecated. Please use 'portal_context=' instead." @portal_context = portal_context end |
.set_portal_state(portal_state) ⇒ Object
Please use #portal_state= instead
174 175 176 177 |
# File 'lib/testcentricity_web/environment.rb', line 174 def self.set_portal_state(portal_state) warn "[DEPRECATION] 'TestCentricity::Environ.set_portal_state' is deprecated. Please use 'portal_state=' instead." @portal_status = portal_state end |
.set_signed_in(signed_in) ⇒ Object
165 166 167 |
# File 'lib/testcentricity_web/environment.rb', line 165 def self.set_signed_in(signed_in) @signed_in = signed_in end |
.test_environment ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/testcentricity_web/environment.rb', line 83 def self.test_environment if @test_environment.blank? nil else @test_environment.downcase.to_sym end end |