Class: Peck::Rails::Controller::LazyValue
- Inherits:
-
Object
- Object
- Peck::Rails::Controller::LazyValue
- Defined in:
- lib/peck_on_rails.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.
79 80 81 |
# File 'lib/peck_on_rails.rb', line 79 def initialize(expression) @expression = expression end |
Instance Method Details
#inspect ⇒ Object
87 88 89 |
# File 'lib/peck_on_rails.rb', line 87 def inspect @expression end |
#to_param(spec) ⇒ Object
83 84 85 |
# File 'lib/peck_on_rails.rb', line 83 def to_param(spec) spec.instance_eval(@expression) end |