Module: Card::Env
- Extended by:
- LocationHistory, Serializable, Serialization, SlotOptions, Support
- Defined in:
- lib/card/env.rb,
lib/card/env/success.rb,
lib/card/env/support.rb,
lib/card/env/location.rb,
lib/card/env/serializable.rb,
lib/card/env/slot_options.rb,
lib/card/env/serialization.rb,
lib/card/env/success/target.rb,
lib/card/env/location_history.rb
Overview
Card::Env is a module for containing the variable details of the environment in which Card operates.
Env can differ for each request; Card.config should not.
Defined Under Namespace
Modules: Location, LocationHistory, Serializable, Serialization, SlotOptions, Support Classes: Success
Class Attribute Summary collapse
-
.controller ⇒ Object
Returns the value of attribute controller.
-
.main_name ⇒ Object
writeonly
Sets the attribute main_name.
-
.params ⇒ Object
writeonly
Sets the attribute params.
- .session ⇒ Object
Attributes included from Serializable
Class Method Summary collapse
- .localhost? ⇒ Boolean
- .request ⇒ Object
- .reset(controller = nil) ⇒ Object
- .success(cardname = nil) ⇒ Object
Methods included from LocationHistory
discard_locations_for, interrupted_action, location_history, previous_location, save_interrupted_action, save_location, save_location?, url_key_for_location
Methods included from SlotOptions
Methods included from Support
hash, reset_session, with_params
Methods included from Serializable
ajax, host, html, ip, origin, protocol
Methods included from Serialization
Class Attribute Details
.controller ⇒ Object
Returns the value of attribute controller.
14 15 16 |
# File 'lib/card/env.rb', line 14 def controller @controller end |
.main_name=(value) ⇒ Object (writeonly)
Sets the attribute main_name
15 16 17 |
# File 'lib/card/env.rb', line 15 def main_name=(value) @main_name = value end |
.params=(value) ⇒ Object (writeonly)
Sets the attribute params
15 16 17 |
# File 'lib/card/env.rb', line 15 def params=(value) @params = value end |
.session ⇒ Object
21 22 23 |
# File 'lib/card/env.rb', line 21 def session @session ||= request&.session || {} end |
Class Method Details
.localhost? ⇒ Boolean
35 36 37 |
# File 'lib/card/env.rb', line 35 def localhost? host&.match?(/^localhost/) end |
.request ⇒ Object
17 18 19 |
# File 'lib/card/env.rb', line 17 def request controller&.request end |
.reset(controller = nil) ⇒ Object
25 26 27 28 29 |
# File 'lib/card/env.rb', line 25 def reset controller=nil @controller = controller @params = controller&.params || {} @session = @success = @serialized = @slot_opts = nil end |