Class: FirefoxJson::Session::Entry
- Defined in:
- lib/firefox-json/session.rb
Overview
The base of the session - a specific viewed site
Instance Attribute Summary collapse
-
#referrer ⇒ Object
readonly
Returns the value of attribute referrer.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from Base
Instance Method Summary collapse
- #domain ⇒ Object
- #hash ⇒ Object
-
#initialize(data, _closed) ⇒ Entry
constructor
A new instance of Entry.
- #to_s ⇒ Object
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
#referrer ⇒ Object (readonly)
Returns the value of attribute referrer.
150 151 152 |
# File 'lib/firefox-json/session.rb', line 150 def referrer @referrer end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
150 151 152 |
# File 'lib/firefox-json/session.rb', line 150 def title @title end |
#url ⇒ Object (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
#domain ⇒ Object
163 164 165 |
# File 'lib/firefox-json/session.rb', line 163 def domain url.split('/')[2] end |
#hash ⇒ Object
167 168 169 |
# File 'lib/firefox-json/session.rb', line 167 def hash url.hash end |
#to_s ⇒ Object
171 172 173 |
# File 'lib/firefox-json/session.rb', line 171 def to_s "#<FirefoxJson::Entry #{url}>" end |