Class: Applitools::AppEnvironment
- Inherits:
-
Object
- Object
- Applitools::AppEnvironment
- Defined in:
- lib/applitools/core/app_environment.rb
Instance Attribute Summary collapse
-
#display_size ⇒ Object
Returns the value of attribute display_size.
-
#hosting_app ⇒ Object
Returns the value of attribute hosting_app.
-
#inferred_environment ⇒ Object
Returns the value of attribute inferred_environment.
-
#os ⇒ Object
Returns the value of attribute os.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AppEnvironment
constructor
A new instance of AppEnvironment.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ AppEnvironment
Returns a new instance of AppEnvironment.
7 8 9 10 11 12 |
# File 'lib/applitools/core/app_environment.rb', line 7 def initialize( = {}) @os = [:os] @hosting_app = [:hosting_app] @display_size = [:display_size] @inferred = [:inferred] end |
Instance Attribute Details
#display_size ⇒ Object
Returns the value of attribute display_size.
5 6 7 |
# File 'lib/applitools/core/app_environment.rb', line 5 def display_size @display_size end |
#hosting_app ⇒ Object
Returns the value of attribute hosting_app.
5 6 7 |
# File 'lib/applitools/core/app_environment.rb', line 5 def hosting_app @hosting_app end |
#inferred_environment ⇒ Object
Returns the value of attribute inferred_environment.
5 6 7 |
# File 'lib/applitools/core/app_environment.rb', line 5 def inferred_environment @inferred_environment end |
#os ⇒ Object
Returns the value of attribute os.
5 6 7 |
# File 'lib/applitools/core/app_environment.rb', line 5 def os @os end |
Instance Method Details
#to_hash ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/applitools/core/app_environment.rb', line 14 def to_hash { 'os' => @os, 'hostingApp' => @hosting_app, 'displaySize' => @display_size && @display_size.to_hash, 'inferred' => @inferred } end |
#to_s ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/applitools/core/app_environment.rb', line 23 def to_s result = '' to_hash.each_pair do |k, v| result << "#{k}: #{v}; " end result end |