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).
478 479 480 |
# File 'lib/lxl.rb', line 478 def self.const_defined?(symbol) #:nodoc: constants.include?(symbol.to_s) end |
.deferred_class ⇒ Object
Default deferred class.
493 494 495 |
# File 'lib/lxl.rb', line 493 def self.deferred_class LXL::Deferred end |
.register_deferred(*symbols) ⇒ Object
505 506 507 508 |
# File 'lib/lxl.rb', line 505 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
518 519 520 521 |
# File 'lib/lxl.rb', line 518 def self.register_symbols(*symbols) symbols.collect! { |s| s.to_s.upcase.to_sym } symbols.each { |s| const_set(s, s) } end |