Class: Devise::CasActionUrlFactoryBase

Inherits:
Object
  • Object
show all
Defined in:
lib/devise_cas_authenticatable/cas_action_url_factory_base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, mapping, action) ⇒ CasActionUrlFactoryBase

Returns a new instance of CasActionUrlFactoryBase.


15
16
17
18
19
# File 'lib/devise_cas_authenticatable/cas_action_url_factory_base.rb', line 15

def initialize(base_url, mapping, action)
  @base_url = base_url
  @mapping  = mapping
  @action   = action
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action


3
4
5
# File 'lib/devise_cas_authenticatable/cas_action_url_factory_base.rb', line 3

def action
  @action
end

#base_urlObject (readonly)

Returns the value of attribute base_url


3
4
5
# File 'lib/devise_cas_authenticatable/cas_action_url_factory_base.rb', line 3

def base_url
  @base_url
end

#mappingObject (readonly)

Returns the value of attribute mapping


3
4
5
# File 'lib/devise_cas_authenticatable/cas_action_url_factory_base.rb', line 3

def mapping
  @mapping
end

Class Method Details

.prepare_classObject


5
6
7
8
9
10
11
12
13
# File 'lib/devise_cas_authenticatable/cas_action_url_factory_base.rb', line 5

def self.prepare_class
  Class.new(self) do
    include Rails.application.routes.url_helpers

    if Rails.application.routes.respond_to?(:mounted_helpers) && Rails.application.routes.mounted_helpers
      include Rails.application.routes.mounted_helpers
    end
  end
end

Instance Method Details

#callObject Also known as: build


21
22
23
24
25
# File 'lib/devise_cas_authenticatable/cas_action_url_factory_base.rb', line 21

def call
  uri      = URI.parse(base_url).tap { |uri| uri.query = nil }
  uri.path = load_base_path
  uri.to_s
end