Class: CafeCar::Context
- Inherits:
-
Object
- Object
- CafeCar::Context
- Defined in:
- lib/cafe_car/context.rb
Instance Method Summary collapse
-
#<<(obj) ⇒ Object
def wrapper(…) = Component.new(@template, [*@prefix], …).wrapper(…).
- #class(name) ⇒ Object
-
#initialize(template, prefix: nil) ⇒ Context
constructor
A new instance of Context.
- #method_missing(name) ⇒ Object
Constructor Details
#initialize(template, prefix: nil) ⇒ Context
Returns a new instance of Context.
3 4 5 6 |
# File 'lib/cafe_car/context.rb', line 3 def initialize(template, prefix: nil) @template = template @prefix = prefix end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Method Details
#<<(obj) ⇒ Object
def wrapper(…) = Component.new(@template, [*@prefix], …).wrapper(…)
10 |
# File 'lib/cafe_car/context.rb', line 10 def <<(obj) = @template.concat(obj) |
#class(name) ⇒ Object
8 9 |
# File 'lib/cafe_car/context.rb', line 8 def class(name, ...) = @template.ui_class([ *@prefix, *name ], ...) # def wrapper(...) = Component.new(@template, [*@prefix], ...).wrapper(...) |