Sha256: bf7293e70b148c4349c7893fd86a6bf7783ccb98b0690b6ce09346523d88840c
Contents?: true
Size: 505 Bytes
Versions: 6
Compression:
Stored size: 505 Bytes
Contents
class Mechanize class Page < Mechanize::File class Image attr_reader :node attr_reader :page def initialize(node, page) @node = node @page = page end def src @node['src'] end def url case src when %r{^https?://} src else if page.bases[0] (page.bases[0].href + src).to_s else (page.uri + src).to_s end end end end end end
Version data entries
6 entries across 6 versions & 3 rubygems