Sha256: fa77da6a2f45b1c7c5f1192a617cba3d8f1ebadf2abc586582a2990c8b4e79fb

Contents?: true

Size: 1.04 KB

Versions: 48

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require 'time'
require 'active_support/core_ext/numeric/time'
require_relative '../../models/configuration'
require_relative '../../support/color_themable'

module Dsu
  module Views
    module Configuration
      class Show
        include Support::ColorThemable

        def initialize(config:, options: {})
          raise ArgumentError, 'config is nil' if config.nil?
          raise ArgumentError, 'config is the wrong object type' unless config.is_a?(Models::Configuration)
          raise ArgumentError, 'options is nil' if options.nil?
          raise ArgumentError, 'options is the wrong object type' unless options.is_a?(Hash)

          @config = config
          @options = options || {}
        end

        def call
          render!
        end
        alias render call

        private

        attr_reader :config, :options

        def render!
          presenter = config.presenter
          puts presenter.configuration_header
          puts presenter.configuration_details
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
dsu-3.0.0.alpha.1 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.0 lib/dsu/views/configuration/show.rb
dsu-2.4.4 lib/dsu/views/configuration/show.rb
dsu-2.4.3 lib/dsu/views/configuration/show.rb
dsu-2.4.2 lib/dsu/views/configuration/show.rb
dsu-2.4.1 lib/dsu/views/configuration/show.rb
dsu-2.4.0 lib/dsu/views/configuration/show.rb
dsu-2.3.2 lib/dsu/views/configuration/show.rb
dsu-2.3.1 lib/dsu/views/configuration/show.rb
dsu-2.3.0 lib/dsu/views/configuration/show.rb
dsu-2.2.2 lib/dsu/views/configuration/show.rb
dsu-2.2.1 lib/dsu/views/configuration/show.rb
dsu-2.2.0 lib/dsu/views/configuration/show.rb
dsu-2.2.0.rc.2 lib/dsu/views/configuration/show.rb
dsu-2.2.0.rc.1 lib/dsu/views/configuration/show.rb
dsu-2.1.4 lib/dsu/views/configuration/show.rb
dsu-2.1.3 lib/dsu/views/configuration/show.rb
dsu-2.1.2 lib/dsu/views/configuration/show.rb
dsu-2.1.1 lib/dsu/views/configuration/show.rb
dsu-2.0.8 lib/dsu/views/configuration/show.rb