Class: Stormpath::Rails::Config::ApplicationResolution

Inherits:
Object
  • Object
show all
Defined in:
lib/stormpath/rails/config/application_resolution.rb

Constant Summary collapse

AUTOMATIC_RESOLUTION_ERROR_MESSAGE =
'Could not automatically resolve a Stormpath Application. '\
'Please specify your Stormpath Application in your configuration.'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(href, name) ⇒ ApplicationResolution

Returns a new instance of ApplicationResolution.



11
12
13
14
# File 'lib/stormpath/rails/config/application_resolution.rb', line 11

def initialize(href, name)
  @href = href
  @name = name
end

Instance Attribute Details

#hrefObject (readonly)

Returns the value of attribute href.



5
6
7
# File 'lib/stormpath/rails/config/application_resolution.rb', line 5

def href
  @href
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/stormpath/rails/config/application_resolution.rb', line 5

def name
  @name
end

Instance Method Details

#appObject



16
17
18
19
20
21
22
23
24
# File 'lib/stormpath/rails/config/application_resolution.rb', line 16

def app
  if href.present?
    app_from_href
  elsif name.present?
    app_from_name
  else
    automatic_resolution
  end
end