Class: WebInspector::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/web_inspector/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options = {}) ⇒ Page

Returns a new instance of Page.



14
15
16
17
18
19
# File 'lib/web_inspector/page.rb', line 14

def initialize(url, options = {})
  @url = url
  @options = options
  @request = WebInspector::Request.new(url)
  @inspector = WebInspector::Inspector.new(page)
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def description
  @description
end

#hostObject (readonly)

Returns the value of attribute host.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def host
  @host
end

#imagesObject (readonly)

Returns the value of attribute images.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def images
  @images
end

Returns the value of attribute links.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def links
  @links
end

#metaObject (readonly)

Returns the value of attribute meta.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def meta
  @meta
end

#portObject (readonly)

Returns the value of attribute port.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def port
  @port
end

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def response
  @response
end

#schemeObject (readonly)

Returns the value of attribute scheme.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def scheme
  @scheme
end

#sizeObject (readonly)

Returns the value of attribute size.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def size
  @size
end

#titleObject (readonly)

Returns the value of attribute title.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



12
13
14
# File 'lib/web_inspector/page.rb', line 12

def url
  @url
end

Instance Method Details

#to_hashObject



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/web_inspector/page.rb', line 57

def to_hash
  {
    'url'           => url,
    'scheme'        => scheme,
    'host'          => host,
    'port'          => port,
    'title'         => title,
    'description'  	=> description,
    'meta'  				=> meta,
    'links'					=> links,
    'images'				=> images,
    'response'      => { 'status'  => response.status,
                         'headers' => response.headers }
  }
end