Class: Innate::Mock::Session

Inherits:
Object
  • Object
show all
Defined in:
/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/mock.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Session) initialize

Returns a new instance of Session



28
29
30
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/mock.rb', line 28

def initialize
  @cookie = nil
end

Instance Attribute Details

Returns the value of attribute cookie



26
27
28
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/mock.rb', line 26

def cookie
  @cookie
end

Instance Method Details



38
39
40
41
42
43
44
45
46
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/mock.rb', line 38

def extract_cookie(method, path, hash = {})
  hash['HTTP_COOKIE'] ||= @cookie if @cookie
  response = Mock::mock(method, path, hash)

  cookie = response['Set-Cookie']
  @cookie = cookie if cookie

  response
end