Class: Peck::Rails::Controller::LazyValue
- Inherits:
-
Object
- Object
- Peck::Rails::Controller::LazyValue
- Defined in:
- lib/peck_on_rails/controller.rb
Overview
Stores expression to be evaluated later in the correct context
Instance Method Summary collapse
-
#initialize(expression) ⇒ LazyValue
constructor
A new instance of LazyValue.
- #inspect ⇒ Object
- #to_param(spec) ⇒ Object
Constructor Details
#initialize(expression) ⇒ LazyValue
Returns a new instance of LazyValue.
29 30 31 |
# File 'lib/peck_on_rails/controller.rb', line 29 def initialize(expression) @expression = expression end |
Instance Method Details
#inspect ⇒ Object
37 38 39 |
# File 'lib/peck_on_rails/controller.rb', line 37 def inspect @expression end |
#to_param(spec) ⇒ Object
33 34 35 |
# File 'lib/peck_on_rails/controller.rb', line 33 def to_param(spec) spec.instance_eval(@expression) end |