Class: Hyrax::PermissionBadge

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
app/presenters/hyrax/permission_badge.rb

Instance Method Summary collapse

Constructor Details

#initialize(visibility_or_document) ⇒ PermissionBadge

Returns a new instance of PermissionBadge.

Parameters:

  • visibility_or_document (String, #visibility)

    the current visibility or an object that has a method returning visibility



7
8
9
# File 'app/presenters/hyrax/permission_badge.rb', line 7

def initialize(visibility_or_document)
  self.visibility = visibility_or_document
end

Instance Method Details

#renderObject

Draws a span tag with styles for a bootstrap label



12
13
14
# File 'app/presenters/hyrax/permission_badge.rb', line 12

def render
  (:span, text, class: "label #{dom_label_class}")
end