Class: Applitools::Session

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_response, new_session) ⇒ Session

Returns a new instance of Session.



9
10
11
12
13
14
# File 'lib/applitools/core/session.rb', line 9

def initialize(server_response, new_session)
  @session_data = server_response
  @id = session_data['id']
  @url = session_data['url']
  @new_session = new_session
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/applitools/core/session.rb', line 5

def id
  @id
end

#session_dataObject (readonly)

Returns the value of attribute session_data.



5
6
7
# File 'lib/applitools/core/session.rb', line 5

def session_data
  @session_data
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/applitools/core/session.rb', line 5

def url
  @url
end

Instance Method Details

#new_session?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
# File 'lib/applitools/core/session.rb', line 16

def new_session?
  unless (result = session_data['isNew']).nil?
    return @new_session unless result.is_a?(TrueClass) | result.is_a?(FalseClass)
    return result
  end
  @new_session
end