Class: RSpec::Parameterized::Core::LazyArg
- Defined in:
- lib/rspec/parameterized/core/lazy_arg.rb
Instance Method Summary collapse
- #apply(obj) ⇒ Object
-
#initialize(&block) ⇒ LazyArg
constructor
A new instance of LazyArg.
- #inspect ⇒ Object
Constructor Details
#initialize(&block) ⇒ LazyArg
Returns a new instance of LazyArg.
5 6 7 |
# File 'lib/rspec/parameterized/core/lazy_arg.rb', line 5 def initialize(&block) @block = block end |
Instance Method Details
#apply(obj) ⇒ Object
9 10 11 |
# File 'lib/rspec/parameterized/core/lazy_arg.rb', line 9 def apply(obj) obj.instance_eval(&@block) end |
#inspect ⇒ Object
13 14 15 16 17 |
# File 'lib/rspec/parameterized/core/lazy_arg.rb', line 13 def inspect "#{@block.to_raw_source}" rescue Parser::SyntaxError super.inspect end |