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.5 lib/dsu/views/configuration/show.rb
dsu-3.0.4 lib/dsu/views/configuration/show.rb
dsu-3.0.3 lib/dsu/views/configuration/show.rb
dsu-3.0.1 lib/dsu/views/configuration/show.rb
dsu-3.0.0 lib/dsu/views/configuration/show.rb
dsu-3.0.0.beta.3 lib/dsu/views/configuration/show.rb
dsu-3.0.0.beta.2 lib/dsu/views/configuration/show.rb
dsu-3.0.0.beta.1 lib/dsu/views/configuration/show.rb
dsu-3.0.0.beta.0 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.12 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.11 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.10 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.9 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.8 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.7 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.6 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.5 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.4 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.3 lib/dsu/views/configuration/show.rb
dsu-3.0.0.alpha.2 lib/dsu/views/configuration/show.rb