Class: ClientDocument
- Inherits:
-
Object
- Object
- ClientDocument
- Defined in:
- lib/sinatra/liveviews/page-websocket.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
Instance Method Summary collapse
- #element(selector) ⇒ Object
-
#initialize(client) ⇒ ClientDocument
constructor
A new instance of ClientDocument.
- #on_load ⇒ Object
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
#location ⇒ Object
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_load ⇒ Object
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 |