Sha256: cdae15b1fdaeea085aac70a5649ef9553411842829c591fc38605aa2d691df71

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

require "hanami/view"

module Milestoner
  module Views
    module Scopes
      # The tag signature specific behavior for partials.
      class TagSignature < Hanami::View::Scope
        def initialize(part: Parts::Tag.new(value: Models::Tag.new), **)
          super(**)
          @part = part
        end

        def tag = locals.fetch :tag, part

        def call
          tag.signature ? render("milestones/tag-secure") : render("milestones/tag-insecure")
        end

        private

        attr_reader :part
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
milestoner-18.12.0 lib/milestoner/views/scopes/tag_signature.rb