Sha256: 8041f7157f5de60b8c63efb321364bcd0656700fd29c4218fba1dcf6a4c465c3
Contents?: true
Size: 568 Bytes
Versions: 8
Compression:
Stored size: 568 Bytes
Contents
require 'forwardable' require 'acceptance_test/page' class PageSet extend Forwardable attr_accessor :session def page session end def execute &code self.instance_eval &code end def self.delegate_to_pages *pages pages.each do |page| class_name = camelize(page.to_s) clazz = Object.const_get(class_name) attr_reader page def_delegators page, *(clazz.instance_methods - Page.instance_methods) end end private def self.camelize string string.split("_").each {|s| s.capitalize! }.join("") end end
Version data entries
8 entries across 8 versions & 1 rubygems