Sha256: f4f0923b35b72dadebf7270d4619b85218ab5af0c6de01bb5ecd85141d27393b

Contents?: true

Size: 435 Bytes

Versions: 8

Compression:

Stored size: 435 Bytes

Contents

module Coco
  module Options
    module Item
      extend ActiveSupport::Concern

      def alias
        @alias || name
      end

      def html_alias
        self.alias.to_s.tr("_", "-")
      end

      def private?
        @private == true
      end

      def public?
        !private?
      end

      class_methods do
        def new(arg, **opts)
          arg.is_a?(self) ? arg : super
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 lib/coco/options/item.rb
coveragebook_components-0.19.7 lib/coco/options/item.rb
coveragebook_components-0.19.6 lib/coco/options/item.rb
coveragebook_components-0.19.5 lib/coco/options/item.rb
coveragebook_components-0.19.4 lib/coco/options/item.rb
coveragebook_components-0.19.3 lib/coco/options/item.rb
coveragebook_components-0.19.2 lib/coco/options/item.rb
coveragebook_components-0.19.1 lib/coco/options/item.rb