Sha256: 53c01f167eb9049dcc58b33f6723dd44056a607cf7fa274eb3694ebb1ce33a09

Contents?: true

Size: 442 Bytes

Versions: 5

Compression:

Stored size: 442 Bytes

Contents

module Lookbook
  module Taggable
    def lookbook_hidden?
      if code_object.tag(:hidden)
        code_object.tag(:hidden).text.strip != "false"
      end
    end

    def lookbook_label
      code_object.tag(:label)&.text
    end

    def lookbook_notes
      code_object.docstring.to_s.strip
    end

    private

    def code_object
      @code_object ||= Lookbook::Engine.parser.get_code_object(taggable_object_path)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lookbook-0.2.4 lib/lookbook/taggable.rb
lookbook-0.2.3 lib/lookbook/taggable.rb
lookbook-0.2.2 lib/lookbook/taggable.rb
lookbook-0.2.1 lib/lookbook/taggable.rb
lookbook-0.2.0 lib/lookbook/taggable.rb