Sha256: 8b1cde252c0ebaae2091d44005243edccf76087fed43ff9809ec45c0d7c34cf4

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbOnlineStatus
    class OnlineStatus < Playbook::PbKit::Base
      PROPS = %i[configured_classname
                 configured_data
                 configured_id
                 configured_status].freeze

      def initialize(classname: default_configuration,
                     data: default_configuration,
                     id: default_configuration,
                     status: default_configuration)
        self.configured_classname = classname
        self.configured_data = data
        self.configured_id = id
        self.configured_status = status
      end

      def status
        status_options = %w[online offline away]
        one_of_value(configured_status, status_options, "offline")
      end

      def kit_class
        kit_options = [
          "pb_online_status",
          status,
        ]
        kit_options.join("_")
      end

      def to_partial_path
        "pb_online_status/online_status"
      end

    private

      DEFAULT = Object.new
      private_constant :DEFAULT
      def default_configuration
        DEFAULT
      end
      attr_accessor(*PROPS)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
playbook_ui-2.8.4 app/pb_kits/playbook/pb_online_status/online_status.rb
playbook_ui-2.8.3 app/pb_kits/playbook/pb_online_status/online_status.rb
playbook_ui-2.8.1 app/pb_kits/playbook/pb_online_status/online_status.rb