Class: Ext

Inherits:
Object
  • Object
show all
Defined in:
lib/ext.rb

Defined Under Namespace

Modules: Controllers, Helper Classes: Assigned, Base, Code, Data, Function, JavaScript

Class Method Summary collapse

Class Method Details

.function(*args, &block) ⇒ Object



19
20
21
22
23
# File 'lib/ext.rb', line 19

def function(*args, &block)
  arg  = args.map(&:to_s).join(',')
  code = "function(%s){%s}" % [arg, block.call]
  Ext::Code.new(code)
end

.onReady(&block) ⇒ Object



14
15
16
17
# File 'lib/ext.rb', line 14

def onReady(&block)
  js = Ext::JavaScript.new(&block)
  "Ext.onReady(%s);" % js.to_function
end

.patchObject



10
11
12
# File 'lib/ext.rb', line 10

def patch
  patches.map{|name, code| code.to_s}.join("\n")
end

.patchesObject



6
7
8
# File 'lib/ext.rb', line 6

def patches
  @patches ||= ActiveSupport::OrderedHash.new
end