Sha256: 06620b29c21345bcc672adee64e5c737cd2ffb7192d3f341f01b08bd12fdabdb

Contents?: true

Size: 448 Bytes

Versions: 65

Compression:

Stored size: 448 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(arg, **opts)
        end
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
coveragebook_components-0.5.4 lib/coco/options/item.rb
coveragebook_components-0.5.3 lib/coco/options/item.rb
coveragebook_components-0.5.2 lib/coco/options/item.rb
coveragebook_components-0.5.1 lib/coco/options/item.rb
coveragebook_components-0.5.0 lib/coco/options/item.rb