Class: QuoraNotify::CookieReaders::CookieReader

Inherits:
Object
  • Object
show all
Defined in:
lib/quora_notify/cookie_readers/cookie_reader.rb

Overview

Subclasses should define a DEFAULT_COOKIE_PATH constant that will be used if no file path is provided to the constructor

Constant Summary collapse

nil

Instance Method Summary collapse

Constructor Details

#initialize(file_path = nil) ⇒ CookieReader

Accepts:

cookie_file_path: Use DEFAULT_COOKIE_PATH if nil (default)


8
9
10
# File 'lib/quora_notify/cookie_readers/cookie_reader.rb', line 8

def initialize(file_path = nil)
  @cookie_file_path = file_path
end

Instance Method Details

Defaults to the standard safari cookie system path



19
20
21
# File 'lib/quora_notify/cookie_readers/cookie_reader.rb', line 19

def cookie_file_path
  @cookie_file_path || self.class::DEFAULT_COOKIE_PATH
end

#read_cookiesObject

Returns an array of Cookie objects Raises: binarycookieReaderException



14
15
16
# File 'lib/quora_notify/cookie_readers/cookie_reader.rb', line 14

def read_cookies
  raise QuoraNotify::Exceptions::CookieReaderException, 'Not implemented'
end