Class: WebammToRails::Sources::Helpers::Devise::Presenter

Inherits:
Object
  • Object
show all
Defined in:
lib/webamm_to_rails/sources/helpers/devise/presenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(waml_definition:) ⇒ Presenter

Returns a new instance of Presenter.



8
9
10
# File 'lib/webamm_to_rails/sources/helpers/devise/presenter.rb', line 8

def initialize(waml_definition:)
  @waml_definition = waml_definition
end

Instance Method Details

#collectionObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/webamm_to_rails/sources/helpers/devise/presenter.rb', line 12

def collection
  return [] if @waml_definition.authentication.blank?
  return [] unless @waml_definition.authentication.any? { |auth| auth.features.include?('two_factor_authentication') }

  [
    {
      path: 'app/helpers/devise_qr_code_helper.rb',
      content: ::WebammToRails::Sources::Helpers::Devise::QrCodeHelper::Presenter.new.render
    }
  ]
end