Sha256: 63749e2c24adaf921bbcf1c8bc343c487c4c76ef6e478a93dab210d90f8b9ca4

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 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
      if code_object&.docstring
        code_object.docstring.to_s.strip
      end
    end

    def lookbook_group
      code_object&.group
    end

    # private

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lookbook-0.3.5 lib/lookbook/taggable.rb
lookbook-0.3.4 lib/lookbook/taggable.rb