Module: Jets::CommonMethods

Extended by:
Memoist
Included in:
AssetTagHelper, UrlHelper
Defined in:
lib/jets/overrides/rails/common_methods.rb

Instance Method Summary collapse

Instance Method Details

#add_stage_name(url) ⇒ Object

Add API Gateway Stage Name



4
5
6
# File 'lib/jets/overrides/rails/common_methods.rb', line 4

def add_stage_name(url)
  Jets::Controller::Stage.add(request.host, url) if request.present?
end

#on_aws?Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/jets/overrides/rails/common_methods.rb', line 8

def on_aws?
  on_cloud9 = Jets::Controller::Stage.on_cloud9?(request.headers['HTTP_HOST'])
  !request.headers['HTTP_X_AMZN_TRACE_ID'].nil? && !on_cloud9
end