Module: Card::Env::Serializable

Included in:
Card::Env
Defined in:
card/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

Instance Method Summary collapse

Instance Attribute Details

#main_nameObject (readonly)

Returns the value of attribute main_name.



6
7
8
# File 'card/lib/card/env/serializable.rb', line 6

def main_name
  @main_name
end

#paramsObject (readonly)

Returns the value of attribute params.



6
7
8
# File 'card/lib/card/env/serializable.rb', line 6

def params
  @params
end

Instance Method Details

#ajaxObject Also known as: ajax?



24
25
26
# File 'card/lib/card/env/serializable.rb', line 24

def ajax
  request&.xhr? || params[:simulate_xhr]
end

#hostObject



16
17
18
# File 'card/lib/card/env/serializable.rb', line 16

def host
  request&.host
end

#htmlObject Also known as: html?



29
30
31
# File 'card/lib/card/env/serializable.rb', line 29

def html
  !controller || params[:format].in?([nil, "html"])
end

#ipObject



8
9
10
# File 'card/lib/card/env/serializable.rb', line 8

def ip
  request&.remote_ip
end

#originObject



20
21
22
# File 'card/lib/card/env/serializable.rb', line 20

def origin
  Cardio.config.deck_origin || "#{protocol}#{request&.host_with_port}"
end

#protocolObject



12
13
14
# File 'card/lib/card/env/serializable.rb', line 12

def protocol
  request&.protocol
end