Sha256: 32206bb7c102334071328f343e47694fb573006f193bef5130a2f85930c8b228

Contents?: true

Size: 858 Bytes

Versions: 2

Compression:

Stored size: 858 Bytes

Contents

module WebammToRails
  module Features
    module DeviseOnlineable
      module Definitions
        module Connection
          class Presenter
            def initialize(waml_definition:)
              @waml_definition = waml_definition
            end

            def render
              template_path = File.expand_path('template.erb', __dir__)
              template_content = File.read(template_path)
              raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })

              ::WebammToRails::Utils::FormatCode.call(raw_content)
            end

            private

            def devise_models
              @waml_definition.authentication.select { |auth| auth.features.include?('online_indication') }.map(&:table).map(&:singularize)
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
webamm_to_rails-7.0.1 lib/webamm_to_rails/features/devise_onlineable/definitions/connection/presenter.rb
webamm_to_rails-7.0.0 lib/webamm_to_rails/features/devise_onlineable/definitions/connection/presenter.rb