Class: Trundle::NamespaceList
- Inherits:
-
Object
- Object
- Trundle::NamespaceList
show all
- Defined in:
- lib/trundle/namespace_list.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of NamespaceList.
2
3
4
|
# File 'lib/trundle/namespace_list.rb', line 2
def initialize
@namespaces = {}
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
18
19
20
|
# File 'lib/trundle/namespace_list.rb', line 18
def method_missing(name, *args, &block)
@namespaces[name.to_sym] = args[0]
end
|
Instance Method Details
#all ⇒ Object
14
15
16
|
# File 'lib/trundle/namespace_list.rb', line 14
def all
@namespaces
end
|
#include?(name) ⇒ Boolean
6
7
8
|
# File 'lib/trundle/namespace_list.rb', line 6
def include?(name)
@namespaces.has_key? name.to_sym
end
|
#key(name) ⇒ Object
10
11
12
|
# File 'lib/trundle/namespace_list.rb', line 10
def key(name)
@namespaces[name.to_sym]
end
|