Sha256: 0c68c1afe7fa858d41a82450e8cd3496711c127596128da44e5c97bcc1c8dc3f

Contents?: true

Size: 475 Bytes

Versions: 16

Compression:

Stored size: 475 Bytes

Contents

# frozen_string_literal: true

module Bs5
  class TooltipService
    using HashRefinement

    attr_reader :title

    def initialize(title, options = {})
      @title = title
      @options = options
    end

    def to_hash
      {
        title: title,
        data: options
      }
    end

    private

    def options
      @options.symbolize_keys.merge(default_options).prefix_keys_with_bs
    end

    def default_options
      { toggle: :tooltip }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bs5-0.0.31 app/service/bs5/tooltip_service.rb
bs5-0.0.30 app/service/bs5/tooltip_service.rb
bs5-0.0.29 app/service/bs5/tooltip_service.rb
bs5-0.0.28 app/service/bs5/tooltip_service.rb
bs5-0.0.27 app/service/bs5/tooltip_service.rb
bs5-0.0.26 app/service/bs5/tooltip_service.rb
bs5-0.0.25 app/service/bs5/tooltip_service.rb
bs5-0.0.24 app/service/bs5/tooltip_service.rb
bs5-0.0.23 app/service/bs5/tooltip_service.rb
bs5-0.0.22 app/service/bs5/tooltip_service.rb
bs5-0.0.21 app/service/bs5/tooltip_service.rb
bs5-0.0.20 app/service/bs5/tooltip_service.rb
bs5-0.0.19 app/service/bs5/tooltip_service.rb
bs5-0.0.18 app/service/bs5/tooltip_service.rb
bs5-0.0.17 app/service/bs5/tooltip_service.rb
bs5-0.0.16 app/service/bs5/tooltip_service.rb