Sha256: 14148aca39bd408f669dcec84acf6ace3d23192a87b611b11fd8c30d0b1eb69e

Contents?: true

Size: 734 Bytes

Versions: 15

Compression:

Stored size: 734 Bytes

Contents

module DataCatalog

  class Sources < Base
    include Resource

    model Source

    # == Permissions

    roles Roles
    permission :list   => :basic
    permission :read   => :basic
    permission :create => :curator
    permission :update => :curator
    permission :delete => :curator
    
    # == Properties

    property :title
    property :url
    property :raw, :w => :admin
    
    property :categories do |source|
      source.categorizations.map do |categorization|
        {
          "id"   => categorization.category.id,
          "href" => "/categories/#{categorization.category.id}",
          "name" => categorization.category.name,
        }
      end
    end

    # == Callbacks
  end
  
  Sources.build

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sinatra_resource-0.4.7 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.6 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.5 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.4 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.3 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.2 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.1 examples/datacatalog/resources/sources.rb
sinatra_resource-0.4.0 examples/datacatalog/resources/sources.rb
sinatra_resource-0.3.6 examples/datacatalog/resources/sources.rb
sinatra_resource-0.3.5 examples/datacatalog/resources/sources.rb
sinatra_resource-0.3.4 examples/datacatalog/resources/sources.rb
sinatra_resource-0.3.3 examples/datacatalog/resources/sources.rb
sinatra_resource-0.3.2 examples/datacatalog/resources/sources.rb
sinatra_resource-0.3.1 examples/datacatalog/resources/sources.rb
sinatra_resource-0.3.0 examples/datacatalog/resources/sources.rb