Netzke::Javascript::Scopes::ClassMethods

Public Instance Methods

js_class_name_to_scope(name) click to toggle source

Given class name, e.g. GridPanelLib::Components::RecordFormWindow, returns its scope: “Components.RecordFormWindow”

# File lib/netzke/javascript/scopes.rb, line 9
def js_class_name_to_scope(name)
  name.split("::")[0..-2].join(".")
end
js_default_scope() click to toggle source

Top level scope which will be used to scope out Netzke classes

# File lib/netzke/javascript/scopes.rb, line 14
def js_default_scope
  "Netzke.classes"
end
js_full_class_name() click to toggle source

Returns the full name of the JavaScript class, including the scopes and the common scope, which is Netzke.classes. E.g.: “Netzke.classes.Netzke.GridPanelLib.RecordFormWindow”

# File lib/netzke/javascript/scopes.rb, line 33
def js_full_class_name
  [js_full_scope, short_component_class_name.split("::").last].join(".")
end
js_full_scope() click to toggle source

Returns the scope of this component e.g. “Netzke.classes.GridPanelLib”

# File lib/netzke/javascript/scopes.rb, line 26
def js_full_scope
  js_scope.empty? ? js_default_scope : [js_default_scope, js_scope].join(".")
end
js_scope() click to toggle source

Scope of this component without default scope e.g.: GridPanelLib.Components

# File lib/netzke/javascript/scopes.rb, line 20
def js_scope
  js_class_name_to_scope(short_component_class_name)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.