Sha256: cfd30351dec4dd50f8411cf06bc66603fd8a5a5d16eed8e6f0a377bf65905818

Contents?: true

Size: 501 Bytes

Versions: 7

Compression:

Stored size: 501 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

    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

7 entries across 7 versions & 1 rubygems

Version Path
lookbook-0.3.3 lib/lookbook/taggable.rb
lookbook-0.3.2 lib/lookbook/taggable.rb
lookbook-0.3.1 lib/lookbook/taggable.rb
lookbook-0.3.0 lib/lookbook/taggable.rb
lookbook-0.3.0.beta.2 lib/lookbook/taggable.rb
lookbook-0.3.0.beta.1 lib/lookbook/taggable.rb
lookbook-0.3.0.beta.0 lib/lookbook/taggable.rb