class ClientElement
Attributes
selector[RW]
Public Class Methods
new(selector, client)
click to toggle source
# File lib/sinatra/liveviews/page-websocket.rb, line 66 def initialize(selector, client) raise 'client must be a WebSocketHelper' unless client.is_a? WebSocketHelper @client = client self.selector = selector.to_s end
Public Instance Methods
execute(method, content)
click to toggle source
# File lib/sinatra/liveviews/page-websocket.rb, line 73 def execute(method, content) @client.send('exec', { :selector => self.selector, :method => method, :content => content.to_s }) end
html=(s)
click to toggle source
# File lib/sinatra/liveviews/page-websocket.rb, line 85 def html=(s) self.execute 'html', s end
text=(s)
click to toggle source
# File lib/sinatra/liveviews/page-websocket.rb, line 81 def text=(s) self.execute 'text', s end