Class: ViewSlots::Namespace
- Inherits:
-
Object
- Object
- ViewSlots::Namespace
- Defined in:
- lib/view_slots/namespace.rb
Instance Method Summary collapse
- #__path__ ⇒ Object
- #add(*args) ⇒ Object
-
#initialize(name, parent = nil) ⇒ Namespace
constructor
A new instance of Namespace.
- #method_missing(m, *args) {|namespace| ... } ⇒ Object
- #remove(*args) ⇒ Object
Constructor Details
#initialize(name, parent = nil) ⇒ Namespace
Returns a new instance of Namespace.
4 5 6 |
# File 'lib/view_slots/namespace.rb', line 4 def initialize(name, parent=nil) @parent, @name = parent, name.to_s end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Method Details
#__path__ ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/view_slots/namespace.rb', line 22 def __path__ if @parent "#{@parent.__path__}:#{@name}" else @name end end |