Top Level Namespace

Includes:
Knj

Defined Under Namespace

Modules: Erubis, GLib, Gdk, GetText, Gtk, Net, ParseDate, Ping, REXML, SOAP, TMail Classes: Appserver_cli, Delegator, Dictionary, ERuby, ExtArray, Fixnum, GladeXML, Knj, KnjController, KnjDB_java_mysql_result, KnjDB_java_sqlite3, KnjDB_java_sqlite3_result, KnjDB_mysql, KnjDB_mysql2_result, KnjDB_mysql_result, KnjDB_mysql_unbuffered_result, KnjDB_sqlite3, KnjDB_sqlite3_ironruby, KnjDB_sqlite3_ironruby_result, KnjDB_sqlite3_result, KnjDB_sqlite3_result_java, KnjEruby, MainWindow, Mutex, Object, QtLoader, QtWindow, SimpleDelegator, String, Symbol, TestWindow, TreeViewColumns, WeakRef, WinAppEdit

Constant Summary collapse

RealGtk =

Hack Gtk

Gtk
RealGdk =

Hack Gdk

Module.const_get("Gdk")

Instance Method Summary collapse

Methods included from Knj

appserver_cli, dirname, knjrbfw_path

Instance Method Details

#_(key) ⇒ Object

This method is used to make gettext work.



189
190
191
# File 'lib/knj/rhodes/rhodes.rb', line 189

def _(key)
  return $rhodes._(key)
end

#_dbObject



26
27
28
# File 'lib/knj/includes/appserver_cli.rb', line 26

def _db
  return $db
end

#_kasObject



22
23
24
# File 'lib/knj/includes/appserver_cli.rb', line 22

def _kas
  return Appserver_cli
end

#_obObject



30
31
32
# File 'lib/knj/includes/appserver_cli.rb', line 30

def _ob
  return $ob
end

#_session(key) ⇒ Object

This method is used to emulate web-behavior and make Knj::Locales.number_out and friends work properly.



184
185
186
# File 'lib/knj/rhodes/rhodes.rb', line 184

def _session(key)
  return $rhodes.session_key(key)
end

#DelegateClass(superclass) ⇒ Object

The primary interface to this library. Use to setup delegation when defining your class.

class MyClass < DelegateClass( ClassToDelegateTo )    # Step 1
  def initialize
    super(obj_of_ClassToDelegateTo)                   # Step 2
  end
end


356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/knj/rhodes/delegate.rb', line 356

def DelegateClass(superclass)
  klass = Class.new(Delegator)
  methods = superclass.instance_methods
  methods -= ::Delegator.public_api
  methods -= [:to_s,:inspect,:=~,:!~,:===]
  klass.module_eval do
    def __getobj__  # :nodoc:
      @delegate_dc_obj
    end
    def __setobj__(obj)  # :nodoc:
      raise ArgumentError, "cannot delegate to self" if self.equal?(obj)
      @delegate_dc_obj = obj
    end
    methods.each do |method|
      define_method(method, Delegator.delegating_block(method))
    end
  end
  klass.define_singleton_method :public_instance_methods do |all=true|
    super(all) - superclass.protected_instance_methods
  end
  klass.define_singleton_method :protected_instance_methods do |all=true|
    super(all) | superclass.protected_instance_methods
  end
  return klass
end