Sha256: 426452ef2277b09926688c418e2c44660c1cb1038de7a2547a3d6709c4cd40a4

Contents?: true

Size: 398 Bytes

Versions: 10

Compression:

Stored size: 398 Bytes

Contents

module Siteleaf
  class Document < Content

    attr_accessor :collection_path
    
    def create_endpoint
      ::File.join("sites", site_id, "collections", collection_identifier, "documents")
    end
    
    def collection
      Collection.find(collection_identifier)
    end
    
    def collection_identifier
      collection_path || directory.match(/_(.*)/).try(:last)
    end
    
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
siteleaf-2.3.0 lib/siteleaf/document.rb
siteleaf-2.2.1 lib/siteleaf/document.rb
siteleaf-2.2.0 lib/siteleaf/document.rb
siteleaf-2.1.2 lib/siteleaf/document.rb
siteleaf-2.1.1 lib/siteleaf/document.rb
siteleaf-2.1.0 lib/siteleaf/document.rb
siteleaf-2.0.2 lib/siteleaf/document.rb
siteleaf-2.0.1 lib/siteleaf/document.rb
siteleaf-2.0.0 lib/siteleaf/document.rb
siteleaf-2.0.0.pre.beta9 lib/siteleaf/document.rb