Method: WebDump#initialize
- Defined in:
- lib/web_dump.rb
#initialize(options = {}) ⇒ WebDump
initializes a WebDump object. options
should be a hash with options for an UriPathname object that will be internally created. Default UriPathnames options and additionally:
:base_dir => directory where everything will be stored (def. '~/web_dumps')
:file_ext => extension that will be appended to filenames (def. '.html')
29 30 31 32 33 34 35 36 |
# File 'lib/web_dump.rb', line 29 def initialize( = {}) attributes = DEFAULT_ATTRS.merge if .is_a? Hash attributes.each { |k,v| instance_eval("@#{k}='#{v}'") if DEFAULT_ATTRS.keys.include?(k) } @up=UriPathname.new attributes # any valid option passed will be delivered end |