Module: Card::Env::Serializable
- Included in:
- Card::Env
- Defined in:
- lib/card/env/serializable.rb
Overview
These methods are all handled in serialization and are thus preserved for the integrate_with_delay phase
Instance Attribute Summary collapse
-
#main_name ⇒ Object
readonly
Returns the value of attribute main_name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #ajax ⇒ Object (also: #ajax?)
- #host ⇒ Object
- #html ⇒ Object (also: #html?)
- #ip ⇒ Object
- #origin ⇒ Object
- #protocol ⇒ Object
Instance Attribute Details
#main_name ⇒ Object (readonly)
Returns the value of attribute main_name.
6 7 8 |
# File 'lib/card/env/serializable.rb', line 6 def main_name @main_name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/card/env/serializable.rb', line 6 def params @params end |
Instance Method Details
#ajax ⇒ Object Also known as: ajax?
24 25 26 |
# File 'lib/card/env/serializable.rb', line 24 def ajax request&.xhr? || params[:simulate_xhr] end |
#host ⇒ Object
16 17 18 |
# File 'lib/card/env/serializable.rb', line 16 def host request&.host end |
#html ⇒ Object Also known as: html?
29 30 31 |
# File 'lib/card/env/serializable.rb', line 29 def html !controller || params[:format].in?([nil, "html"]) end |
#ip ⇒ Object
8 9 10 |
# File 'lib/card/env/serializable.rb', line 8 def ip request&.remote_ip end |
#origin ⇒ Object
20 21 22 |
# File 'lib/card/env/serializable.rb', line 20 def origin Cardio.config.deck_origin || "#{protocol}#{request&.host_with_port}" end |
#protocol ⇒ Object
12 13 14 |
# File 'lib/card/env/serializable.rb', line 12 def protocol request&.protocol end |