Class: Applitools::AppEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/core/app_environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ AppEnvironment

Returns a new instance of AppEnvironment.



5
6
7
8
9
10
# File 'lib/applitools/core/app_environment.rb', line 5

def initialize(options = {})
  @os = options[:os]
  @hosting_app = options[:hosting_app]
  @display_size = options[:display_size]
  @inferred = options[:inferred]
end

Instance Attribute Details

#display_sizeObject

Returns the value of attribute display_size.



3
4
5
# File 'lib/applitools/core/app_environment.rb', line 3

def display_size
  @display_size
end

#hosting_appObject

Returns the value of attribute hosting_app.



3
4
5
# File 'lib/applitools/core/app_environment.rb', line 3

def hosting_app
  @hosting_app
end

#inferred_environmentObject

Returns the value of attribute inferred_environment.



3
4
5
# File 'lib/applitools/core/app_environment.rb', line 3

def inferred_environment
  @inferred_environment
end

#osObject

Returns the value of attribute os.



3
4
5
# File 'lib/applitools/core/app_environment.rb', line 3

def os
  @os
end

Instance Method Details

#to_hashObject



12
13
14
15
16
17
18
19
# File 'lib/applitools/core/app_environment.rb', line 12

def to_hash
  {
    'os' => @os,
    'hostingApp' => @hosting_app,
    'displaySize' => @display_size && @display_size.to_hash,
    'inferred' => @inferred
  }
end

#to_sObject



21
22
23
24
25
26
27
# File 'lib/applitools/core/app_environment.rb', line 21

def to_s
  result = ''
  to_hash.each_pair do |k, v|
    result << "#{k}: #{v}; "
  end
  result
end