Class: FirefoxJson::Session::Entry

Inherits:
Base
  • Object
show all
Defined in:
lib/firefox-json/session.rb

Overview

The base of the session - a specific viewed site

Instance Attribute Summary collapse

Attributes inherited from Base

#path

Instance Method Summary collapse

Methods inherited from Base

children, choose_for, #dump, #eql?, inherited, #inspect, mattr_accessor, #reload, required_key=, #save, set_collection

Constructor Details

#initialize(data, _closed) ⇒ Entry

Returns a new instance of Entry.



153
154
155
156
157
158
159
160
161
# File 'lib/firefox-json/session.rb', line 153

def initialize data, _closed
  setup data
  @url = data['url']
  @title = data['title']
  @referrer = data['referrer']
  @id = data['id']
  @docshell_id = data['docshellID']
  @doc_identifier = data['docIdentifier']
end

Instance Attribute Details

#referrerObject (readonly)

Returns the value of attribute referrer.



150
151
152
# File 'lib/firefox-json/session.rb', line 150

def referrer
  @referrer
end

#titleObject (readonly)

Returns the value of attribute title.



150
151
152
# File 'lib/firefox-json/session.rb', line 150

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



150
151
152
# File 'lib/firefox-json/session.rb', line 150

def url
  @url
end

Instance Method Details

#domainObject



163
164
165
# File 'lib/firefox-json/session.rb', line 163

def domain
  url.split('/')[2]
end

#hashObject



167
168
169
# File 'lib/firefox-json/session.rb', line 167

def hash
  url.hash
end

#to_sObject



171
172
173
# File 'lib/firefox-json/session.rb', line 171

def to_s
  "#<FirefoxJson::Entry #{url}>"
end