Class: ViewSpec::ExecutableProc

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

Instance Method Summary collapse

Constructor Details

#initialize(proc) ⇒ ExecutableProc

Returns a new instance of ExecutableProc.



3
4
5
# File 'lib/view_spec/executable_proc.rb', line 3

def initialize(proc)
  @executable = proc
end

Instance Method Details

#langObject



11
12
13
# File 'lib/view_spec/executable_proc.rb', line 11

def lang
  :ruby
end

#sourceObject



7
8
9
# File 'lib/view_spec/executable_proc.rb', line 7

def source
  CGI.unescapeHTML inner_source.strip_heredoc.strip
end

#to_procObject Also known as: raw



15
16
17
# File 'lib/view_spec/executable_proc.rb', line 15

def to_proc
  @executable
end