Class: MockedHttpSession
- Inherits:
-
Object
- Object
- MockedHttpSession
- Includes:
- HttpSession
- Defined in:
- lib/spec/vraptor/mocked_http_session.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#context ⇒ Object
Returns the value of attribute context.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
- #get_attribute(x) ⇒ Object
- #get_id ⇒ Object
- #get_servlet_context ⇒ Object
-
#initialize(context, map, id) ⇒ MockedHttpSession
constructor
A new instance of MockedHttpSession.
- #remove_attribute(key) ⇒ Object
- #set_attribute(x, y) ⇒ Object
Constructor Details
#initialize(context, map, id) ⇒ MockedHttpSession
Returns a new instance of MockedHttpSession.
9 10 11 12 13 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 9 def initialize(context, map, id) @context = context @attributes = map @id = id end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 3 def attributes @attributes end |
#context ⇒ Object
Returns the value of attribute context.
3 4 5 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 3 def context @context end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 3 def id @id end |
Instance Method Details
#get_attribute(x) ⇒ Object
19 20 21 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 19 def get_attribute(x) @attributes[x] end |
#get_id ⇒ Object
5 6 7 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 5 def get_id @id end |
#get_servlet_context ⇒ Object
23 24 25 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 23 def get_servlet_context @context end |
#remove_attribute(key) ⇒ Object
27 28 29 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 27 def remove_attribute(key) @attributes.delete(key) end |
#set_attribute(x, y) ⇒ Object
15 16 17 |
# File 'lib/spec/vraptor/mocked_http_session.rb', line 15 def set_attribute(x, y) @attributes.merge!({x => y}) end |