Class: LXL::EmptyNamespace
- Inherits:
-
Object
- Object
- LXL::EmptyNamespace
- Defined in:
- lib/lxl.rb
Overview
Namespace lookup for constants and functions (minimal methods).
Direct Known Subclasses
Constant Summary collapse
- METHODS =
Preserved methods
['__id__', '__send__', 'constants', 'const_defined?', 'const_get', 'const_set', 'class', 'instance_methods', 'method', 'methods', 'respond_to?', 'to_s']
Class Method Summary collapse
-
.const_defined?(symbol) ⇒ Boolean
Ensure all constants are included (inherited, extended, included, etc).
-
.deferred_class ⇒ Object
Default deferred class.
-
.register_deferred(*symbols) ⇒ Object
Register lowercase methods which return a Deferred function call.
-
.register_symbols(*symbols) ⇒ Object
Register uppercase constants of the same name and value.
Class Method Details
.const_defined?(symbol) ⇒ Boolean
Ensure all constants are included (inherited, extended, included, etc).
511 512 513 |
# File 'lib/lxl.rb', line 511 def self.const_defined?(symbol) #:nodoc: constants.include?(symbol.to_s) end |
.deferred_class ⇒ Object
Default deferred class.
526 527 528 |
# File 'lib/lxl.rb', line 526 def self.deferred_class LXL::Deferred end |
.register_deferred(*symbols) ⇒ Object
538 539 540 541 |
# File 'lib/lxl.rb', line 538 def self.register_deferred(*symbols) symbols.collect! { |s| s.to_s.downcase.to_sym } symbols.each { |s| define_method(s) { |*args| self.class.deferred_class.new(s, *args) } } end |
.register_symbols(*symbols) ⇒ Object
551 552 553 554 |
# File 'lib/lxl.rb', line 551 def self.register_symbols(*symbols) symbols.collect! { |s| s.to_s.upcase.to_sym } symbols.each { |s| const_set(s, s) } end |