Class: ClientDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/liveviews/page-websocket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ClientDocument

Returns a new instance of ClientDocument.



47
48
49
50
# File 'lib/sinatra/liveviews/page-websocket.rb', line 47

def initialize(client)
	raise 'client must be a WebSocketHelper' unless client.is_a? WebSocketHelper
	@client = client
end

Instance Attribute Details

#locationObject

Returns the value of attribute location.



45
46
47
# File 'lib/sinatra/liveviews/page-websocket.rb', line 45

def location
  @location
end

Instance Method Details

#element(selector) ⇒ Object



52
53
54
# File 'lib/sinatra/liveviews/page-websocket.rb', line 52

def element(selector)
	ClientElement.new(selector, @client)
end

#on_loadObject



56
57
58
59
60
# File 'lib/sinatra/liveviews/page-websocket.rb', line 56

def on_load
	# maybe later we can do something else with this, but for now
	# just call the load method straight away
	yield()
end