Class: VersatileRJS::Proxy::ElementProxy

Inherits:
VersatileRJS::Proxy show all
Includes:
FrameworkDependent, Selectable
Defined in:
lib/versatile_rjs/proxy/element_proxy.rb

Direct Known Subclasses

Jquery::ElementProxy

Instance Method Summary collapse

Methods included from Selectable

#select

Methods included from FrameworkDependent

included

Methods inherited from VersatileRJS::Proxy

#call, #initialize, #method_missing, #to_json

Constructor Details

This class inherits a constructor from VersatileRJS::Proxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class VersatileRJS::Proxy

Instance Method Details

#args(method, *args) ⇒ Object



57
58
59
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 57

def args(method, *args)
  self.class.args(method, *args)
end

#hideObject



41
42
43
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 41

def hide
  page.append_statement call(js_method(:hide))
end

#inner_html=(html) ⇒ Object



49
50
51
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 49

def inner_html=(html)
  replace_html(html)
end

#insert_html(position, *args) ⇒ Object



19
20
21
22
23
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 19

def insert_html(position, *args)
  content = page.execute_rendering(*args)
  arguments = Array(self.args(:insert_html, position, content))
  page.append_statement call(js_method(:insert_html, position), *arguments)
end

#js_method(method, *args) ⇒ Object



53
54
55
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 53

def js_method(method, *args)
  self.class.js_method(method, *args)
end

#removeObject



25
26
27
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 25

def remove
  page.append_statement call(js_method(:remove))
end

#replace(*args) ⇒ Object



15
16
17
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 15

def replace(*args)
  page.append_statement call(js_method(:replace), page.execute_rendering(*args))
end

#replace_html(*args) ⇒ Object



11
12
13
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 11

def replace_html(*args)
  page.append_statement call(js_method(:replace_html), page.execute_rendering(*args))
end

#showObject



37
38
39
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 37

def show
  page.append_statement call(js_method(:show))
end

#toggleObject



45
46
47
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 45

def toggle
  page.append_statement call(js_method(:toggle))
end

#valueObject



29
30
31
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 29

def value
  call(js_method(:value))
end

#value=(value) ⇒ Object



33
34
35
# File 'lib/versatile_rjs/proxy/element_proxy.rb', line 33

def value=(value)
  page.append_statement call(js_method(:value=), value)
end