Class: Peck::Rails::Controller::LazyValue

Inherits:
Object
  • Object
show all
Defined in:
lib/peck_on_rails.rb

Overview

Stores expression to be evaluated later in the correct context

Instance Method Summary collapse

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

#inspectObject



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