Class: Wrapper
Instance Method Summary collapse
-
#initialize(description: nil, &block) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #inspect ⇒ Object
- #to_s ⇒ Object
- #unwrap(context: nil) ⇒ Object
Constructor Details
#initialize(description: nil, &block) ⇒ Wrapper
Returns a new instance of Wrapper.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/nrser/rspex.rb', line 63 def initialize description: nil, &block case description when Symbol @description = description.to_s if block raise ArgumentError, "Don't provide block with symbol" end if @description.start_with? '@' @block = Proc.new { instance_variable_get description } else @block = description.to_proc end else @description = description @block = block end end |