class WWW_App::JavaScript::DSL
Public Class Methods
new(&blok)
click to toggle source
# File lib/www_app/JavaScript.rb, line 9 def initialize &blok @js = [] instance_eval &blok end
Public Instance Methods
<<(*args)
click to toggle source
# File lib/www_app/JavaScript.rb, line 35 def << *args @js.<<(*args) end
capture(&blok)
click to toggle source
# File lib/www_app/JavaScript.rb, line 39 def capture &blok orig = @js new = [] @js = new instance_eval &blok @js = orig new end
concat(arr)
click to toggle source
# File lib/www_app/JavaScript.rb, line 31 def concat arr @js.concat(arr) end
raw_code()
click to toggle source
# File lib/www_app/JavaScript.rb, line 27 def raw_code @js end
run_method(name, args)
click to toggle source
# File lib/www_app/JavaScript.rb, line 21 def run_method name, args self << name self << args self end