Module: Ncurses::Namespace

Defined in:
lib/ncurses.rb

Overview

Some users like to include ncurses names despite namespace pollution This module is for them

Class Method Summary (collapse)

Class Method Details

+ (Object) append_features(target)



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/ncurses.rb', line 318

def self.append_features(target)
  # include constants
  unless target.ancestors.member?(Ncurses)
    target.__send__(:include, Ncurses)
  end
  
  # make methods available
  unless target.respond_to?(:pre_Ncurses_method_missing)
    target.module_eval{
      alias pre_Ncurses_method_missing method_missing
      def method_missing(name, *args)
        if Ncurses.respond_to?(name)
          Ncurses.send(name, *args)
        else
          pre_Ncurses_method_missing(name, *args)
        end
      end
    }
  end
end

+ (Object) entend_object(object)



338
339
340
341
342
# File 'lib/ncurses.rb', line 338

def self.entend_object(object)
  class << object
    self
  end.__send__(:include, self)
end