Class: Browserctl::PageSession

Inherits:
Object
  • Object
show all
Defined in:
lib/browserctl/server/page_session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ PageSession

Returns a new instance of PageSession.



8
9
10
11
12
13
14
15
16
17
# File 'lib/browserctl/server/page_session.rb', line 8

def initialize(page)
  @page              = page
  @mutex             = Mutex.new
  @pause_cv          = ConditionVariable.new
  @ref_registry      = {}
  @fingerprint_index = {}
  @snapshot_id       = nil
  @prev_snapshot     = nil
  @paused            = false
end

Instance Attribute Details

#fingerprint_indexObject

Returns the value of attribute fingerprint_index.



6
7
8
# File 'lib/browserctl/server/page_session.rb', line 6

def fingerprint_index
  @fingerprint_index
end

#mutexObject (readonly)

Returns the value of attribute mutex.



5
6
7
# File 'lib/browserctl/server/page_session.rb', line 5

def mutex
  @mutex
end

#pageObject (readonly)

Returns the value of attribute page.



5
6
7
# File 'lib/browserctl/server/page_session.rb', line 5

def page
  @page
end

#pause_cvObject (readonly)

Returns the value of attribute pause_cv.



5
6
7
# File 'lib/browserctl/server/page_session.rb', line 5

def pause_cv
  @pause_cv
end

#prev_snapshotObject

Returns the value of attribute prev_snapshot.



6
7
8
# File 'lib/browserctl/server/page_session.rb', line 6

def prev_snapshot
  @prev_snapshot
end

#ref_registryObject

Returns the value of attribute ref_registry.



6
7
8
# File 'lib/browserctl/server/page_session.rb', line 6

def ref_registry
  @ref_registry
end

#snapshot_idObject

Returns the value of attribute snapshot_id.



6
7
8
# File 'lib/browserctl/server/page_session.rb', line 6

def snapshot_id
  @snapshot_id
end

Instance Method Details

#pause!Object



20
# File 'lib/browserctl/server/page_session.rb', line 20

def pause!  = (@paused = true)

#paused?Boolean

Returns:

  • (Boolean)


19
# File 'lib/browserctl/server/page_session.rb', line 19

def paused? = @paused

#resume!Object



21
# File 'lib/browserctl/server/page_session.rb', line 21

def resume! = (@paused = false)