Module: Webrat::Methods

Defined in:
lib/webrat/core/methods.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.delegate_to_session(*meths) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/webrat/core/methods.rb', line 4

def self.delegate_to_session(*meths)
  meths.each do |meth|
    self.class_eval <<-RUBY
      def #{meth}(*args, &blk)
        webrat_session.#{meth}(*args, &blk)
      end
    RUBY
  end
end

Instance Method Details

#webratObject



14
15
16
# File 'lib/webrat/core/methods.rb', line 14

def webrat
  webrat_session
end

#webrat_sessionObject



18
19
20
# File 'lib/webrat/core/methods.rb', line 18

def webrat_session
  @_webrat_session ||= ::Webrat.session_class.new(self)
end