Sha256: bfec17d0a58fb60c6a2569298b9c644de52b535299efe4d56099eb46bd794128
Contents?: true
Size: 747 Bytes
Versions: 48
Compression:
Stored size: 747 Bytes
Contents
# frozen_string_literal: true require 'delegate' require_relative '../models/color_theme' require_relative '../support/color_themable' module Dsu module Presenters class BasePresenter < SimpleDelegator include Support::ColorThemable attr_reader :color_theme def initialize(object, options: {}) super(object) @options = options || {} theme_name = options.fetch(:theme_name, Models::Configuration.new.theme_name) @color_theme = Models::ColorTheme.find(theme_name: theme_name) end private attr_reader :options def formatted_index(index:) apply_theme("#{format('%02s', index + 1)}. ", theme_color: color_theme.index) end end end end
Version data entries
48 entries across 48 versions & 1 rubygems