Sha256: ad54d68697e1381ea05bbc8b5e181118a42d86dd6675701c30bfa0209a4511c7

Contents?: true

Size: 637 Bytes

Versions: 21

Compression:

Stored size: 637 Bytes

Contents

module Lookbook
  class Entity
    include Utils

    def initialize(reference_path)
      @refpath = reference_path
    end

    def id
      generate_id(lookup_path)
    end

    def label
      lookup_path.split("/").last.titleize
    end

    def type
      :item
    end

    def path
      @refpath
    end

    def lookup_path
      @lookup_path ||= to_lookup_path(@refpath)
    end

    def hierarchy_depth
      @refpath.present? ? @refpath.split("/").size : 0
    end

    def position
      0
    end

    def hidden?
      false
    end

    def matchers
      nil
    end

    alias_method :url_path, :lookup_path
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lookbook-1.3.4 lib/lookbook/entity.rb
lookbook-1.3.3 lib/lookbook/entity.rb
lookbook-1.3.1 lib/lookbook/entity.rb
lookbook-1.3.0 lib/lookbook/entity.rb
lookbook-1.2.1 lib/lookbook/entity.rb
lookbook-1.2.0 lib/lookbook/entity.rb
lookbook-1.1.1 lib/lookbook/entity.rb
lookbook-1.1.0 lib/lookbook/entity.rb
lookbook-1.0.8 lib/lookbook/entity.rb
lookbook-1.0.7 lib/lookbook/entity.rb
lookbook-1.0.6 lib/lookbook/entity.rb
lookbook-1.0.5 lib/lookbook/entity.rb
lookbook-1.0.4 lib/lookbook/entity.rb
lookbook-1.0.3 lib/lookbook/entity.rb
lookbook-1.0.2 lib/lookbook/entity.rb
lookbook-1.0.1 lib/lookbook/entity.rb
lookbook-1.0.0 lib/lookbook/entity.rb
lookbook-1.0.0.rc.3 lib/lookbook/entity.rb
lookbook-1.0.0.rc.2 lib/lookbook/entity.rb
lookbook-1.0.0.rc.1 lib/lookbook/entity.rb