Sha256: ec03f5e0797f03c83a61ff01a4a07975ef87161793df1e1871f0f60be6bf67ff

Contents?: true

Size: 631 Bytes

Versions: 8

Compression:

Stored size: 631 Bytes

Contents

module DataCatalog

  class Sources < Base
    include Resource

    model Source

    # == Permissions

    roles Roles
    permission :read   => :basic
    permission :modify => :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

8 entries across 8 versions & 1 rubygems

Version Path
sinatra_resource-0.2.6 examples/datacatalog/resources/sources.rb
sinatra_resource-0.2.5 examples/datacatalog/resources/sources.rb
sinatra_resource-0.2.4 examples/datacatalog/resources/sources.rb
sinatra_resource-0.2.3 examples/datacatalog/resources/sources.rb
sinatra_resource-0.2.2 examples/datacatalog/resources/sources.rb
sinatra_resource-0.2.1 examples/datacatalog/resources/sources.rb
sinatra_resource-0.2.0 examples/datacatalog/resources/sources.rb
sinatra_resource-0.1.0 examples/datacatalog/resources/sources.rb