Class: UserApplicationPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/user_application_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application, scopes, authorization_id = nil) ⇒ UserApplicationPresenter

Returns a new instance of UserApplicationPresenter.


6
7
8
9
10
# File 'app/presenters/user_application_presenter.rb', line 6

def initialize(application, scopes, authorization_id=nil)
  @app = application
  @scopes = scopes
  @authorization_id = authorization_id
end

Instance Attribute Details

#scopesObject (readonly)

Returns the value of attribute scopes


4
5
6
# File 'app/presenters/user_application_presenter.rb', line 4

def scopes
  @scopes
end

Instance Method Details

#idObject


12
13
14
# File 'app/presenters/user_application_presenter.rb', line 12

def id
  @authorization_id
end

#imageObject


20
21
22
# File 'app/presenters/user_application_presenter.rb', line 20

def image
  @app.image_uri
end

#nameObject


16
17
18
# File 'app/presenters/user_application_presenter.rb', line 16

def name
  @app.client_name
end

#name?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'app/presenters/user_application_presenter.rb', line 32

def name?
  @app.client_name.present?
end

#policyObject


28
29
30
# File 'app/presenters/user_application_presenter.rb', line 28

def policy
  @app.policy_uri
end

#policy?Boolean

Returns:

  • (Boolean)

40
41
42
# File 'app/presenters/user_application_presenter.rb', line 40

def policy?
  @app.policy_uri.present?
end

#terms_of_servicesObject


24
25
26
# File 'app/presenters/user_application_presenter.rb', line 24

def terms_of_services
  @app.tos_uri
end

#terms_of_services?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'app/presenters/user_application_presenter.rb', line 36

def terms_of_services?
  @app.tos_uri.present?
end

#urlObject


44
45
46
47
48
# File 'app/presenters/user_application_presenter.rb', line 44

def url
  client_redirect = URI(@app.redirect_uris[0])
  client_redirect.path = "/"
  client_redirect.to_s
end