Class: QuoraNotify::CookieReaders::CookieIO

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

Instance Method Summary collapse

Instance Method Details

#nextObject



5
6
7
# File 'lib/quora_notify/cookie_readers.rb', line 5

def next
  self.read(4)
end

#next_as_intObject



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

def next_as_int
  self.next.unpack('l<')[0]
end

#read_as_dateObject



23
24
25
# File 'lib/quora_notify/cookie_readers.rb', line 23

def read_as_date
  self.read(8).unpack('E')[0] + 978307200
end

#read_as_flagObject



13
14
15
16
17
18
19
20
21
# File 'lib/quora_notify/cookie_readers.rb', line 13

def read_as_flag
  case self.next_as_int
    when 0; ''
    when 1; 'Secure'
    when 4; 'HttpOnly'
    when 5; 'Secure: HttpOnly'
    else; 'Unknown'
  end
end